@@ -14,13 +14,17 @@ use vfs::{loader::Handle, AbsPath, AbsPathBuf};
14
14
15
15
use crate :: reload:: { ProjectFolders , SourceRootConfig } ;
16
16
17
- pub ( crate ) struct LoadCargoConfig {
18
- pub ( crate ) load_out_dirs_from_check : bool ,
19
- pub ( crate ) with_proc_macro : bool ,
20
- pub ( crate ) prefill_caches : bool ,
17
+ // Note: Since this type is used by external tools that use rust-analyzer as a library
18
+ // what otherwise would be `pub(crate)` has to be `pub` here instead.
19
+ pub struct LoadCargoConfig {
20
+ pub load_out_dirs_from_check : bool ,
21
+ pub with_proc_macro : bool ,
22
+ pub prefill_caches : bool ,
21
23
}
22
24
23
- pub ( crate ) fn load_workspace_at (
25
+ // Note: Since this function is used by external tools that use rust-analyzer as a library
26
+ // what otherwise would be `pub(crate)` has to be `pub` here instead.
27
+ pub fn load_workspace_at (
24
28
root : & Path ,
25
29
cargo_config : & CargoConfig ,
26
30
load_config : & LoadCargoConfig ,
@@ -33,7 +37,12 @@ pub(crate) fn load_workspace_at(
33
37
load_workspace ( workspace, cargo_config, load_config, progress)
34
38
}
35
39
36
- fn load_workspace (
40
+ // Note: Since this function is used by external tools that use rust-analyzer as a library
41
+ // what otherwise would be `pub(crate)` has to be `pub` here instead.
42
+ //
43
+ // The reason both, `load_workspace_at` and `load_workspace` are `pub` is that some of
44
+ // these tools need access to `ProjectWorkspace`, too, which `load_workspace_at` hides.
45
+ pub fn load_workspace (
37
46
mut ws : ProjectWorkspace ,
38
47
cargo_config : & CargoConfig ,
39
48
load_config : & LoadCargoConfig ,
0 commit comments