From d6c204c75050052417a8d6f4f2b08b210b62d805 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 24 Jun 2020 18:54:05 +0200 Subject: Cleanup visibility --- crates/rust-analyzer/src/global_state.rs | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index e7eeb60ee..7d6d24369 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() -- cgit v1.2.3