@@ -14,13 +14,17 @@ use vfs::{loader::Handle, AbsPath, AbsPathBuf};
1414
1515use crate :: reload:: { ProjectFolders , SourceRootConfig } ;
1616
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 ,
2123}
2224
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 (
2428 root : & Path ,
2529 cargo_config : & CargoConfig ,
2630 load_config : & LoadCargoConfig ,
@@ -33,7 +37,12 @@ pub(crate) fn load_workspace_at(
3337 load_workspace ( workspace, cargo_config, load_config, progress)
3438}
3539
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 (
3746 mut ws : ProjectWorkspace ,
3847 cargo_config : & CargoConfig ,
3948 load_config : & LoadCargoConfig ,
0 commit comments