mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 05:38:46 +00:00
Make world private
This commit is contained in:
parent
8abf536343
commit
fce6bc0acc
1 changed files with 7 additions and 13 deletions
|
@ -56,7 +56,7 @@ pub struct WorldState {
|
||||||
data: Arc<WorldData>
|
data: Arc<WorldData>
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct World {
|
pub(crate) struct World {
|
||||||
needs_reindex: AtomicBool,
|
needs_reindex: AtomicBool,
|
||||||
file_resolver: Arc<FileResolver>,
|
file_resolver: Arc<FileResolver>,
|
||||||
data: Arc<WorldData>,
|
data: Arc<WorldData>,
|
||||||
|
@ -88,22 +88,16 @@ impl WorldState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn snapshot(
|
|
||||||
&self,
|
|
||||||
file_resolver: impl FileResolver,
|
|
||||||
) -> World {
|
|
||||||
World {
|
|
||||||
needs_reindex: AtomicBool::new(false),
|
|
||||||
file_resolver: Arc::new(file_resolver),
|
|
||||||
data: self.data.clone()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn analysis(
|
pub fn analysis(
|
||||||
&self,
|
&self,
|
||||||
file_resolver: impl FileResolver,
|
file_resolver: impl FileResolver,
|
||||||
) -> Analysis {
|
) -> Analysis {
|
||||||
Analysis { imp: self.snapshot(file_resolver) }
|
let imp = World {
|
||||||
|
needs_reindex: AtomicBool::new(false),
|
||||||
|
file_resolver: Arc::new(file_resolver),
|
||||||
|
data: self.data.clone()
|
||||||
|
};
|
||||||
|
Analysis { imp }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn change_file(&mut self, file_id: FileId, text: Option<String>) {
|
pub fn change_file(&mut self, file_id: FileId, text: Option<String>) {
|
||||||
|
|
Loading…
Reference in a new issue