diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index e7eeb60eea3..7d6d2436982 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs @@ -46,32 +46,32 @@ fn create_flycheck(workspaces: &[ProjectWorkspace], config: &FlycheckConfig) -> /// snapshot of the file systems, and `analysis_host`, which stores our /// incremental salsa database. #[derive(Debug)] -pub struct GlobalState { - pub config: Config, - pub workspaces: Arc>, - pub analysis_host: AnalysisHost, - pub loader: Box, - pub task_receiver: Receiver, - pub flycheck: Option, - pub diagnostics: DiagnosticCollection, - pub proc_macro_client: ProcMacroClient, +pub(crate) struct GlobalState { + pub(crate) config: Config, + pub(crate) workspaces: Arc>, + pub(crate) analysis_host: AnalysisHost, + pub(crate) loader: Box, + pub(crate) task_receiver: Receiver, + pub(crate) flycheck: Option, + pub(crate) diagnostics: DiagnosticCollection, + pub(crate) proc_macro_client: ProcMacroClient, pub(crate) vfs: Arc)>>, pub(crate) latest_requests: Arc>, source_root_config: SourceRootConfig, } /// An immutable snapshot of the world's state at a point in time. -pub struct GlobalStateSnapshot { - pub config: Config, - pub workspaces: Arc>, - pub analysis: Analysis, - pub check_fixes: CheckFixes, +pub(crate) struct GlobalStateSnapshot { + pub(crate) config: Config, + pub(crate) workspaces: Arc>, + pub(crate) analysis: Analysis, + pub(crate) check_fixes: CheckFixes, pub(crate) latest_requests: Arc>, vfs: Arc)>>, } impl GlobalState { - pub fn new( + pub(crate) fn new( workspaces: Vec, lru_capacity: Option, config: Config, @@ -241,7 +241,7 @@ impl GlobalStateSnapshot { self.vfs.read().1[&id] } - pub fn anchored_path(&self, file_id: FileId, path: &str) -> Url { + pub(crate) fn anchored_path(&self, file_id: FileId, path: &str) -> Url { let mut base = self.vfs.read().0.file_path(file_id); base.pop(); let path = base.join(path); @@ -264,7 +264,7 @@ impl GlobalStateSnapshot { }) } - pub fn status(&self) -> String { + pub(crate) fn status(&self) -> String { let mut buf = String::new(); if self.workspaces.is_empty() { buf.push_str("no workspaces\n") @@ -349,7 +349,7 @@ pub(crate) struct SourceRootConfig { } impl SourceRootConfig { - pub fn partition(&self, vfs: &vfs::Vfs) -> Vec { + pub(crate) fn partition(&self, vfs: &vfs::Vfs) -> Vec { self.fsc .partition(vfs) .into_iter()