aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/libanalysis/src/lib.rs18
1 files changed, 6 insertions, 12 deletions
diff --git a/crates/libanalysis/src/lib.rs b/crates/libanalysis/src/lib.rs
index ec20d106f..3f54a7f0d 100644
--- a/crates/libanalysis/src/lib.rs
+++ b/crates/libanalysis/src/lib.rs
@@ -56,7 +56,7 @@ pub struct WorldState {
56 data: Arc<WorldData> 56 data: Arc<WorldData>
57} 57}
58 58
59pub struct World { 59pub(crate) struct World {
60 needs_reindex: AtomicBool, 60 needs_reindex: AtomicBool,
61 file_resolver: Arc<FileResolver>, 61 file_resolver: Arc<FileResolver>,
62 data: Arc<WorldData>, 62 data: Arc<WorldData>,
@@ -88,22 +88,16 @@ impl WorldState {
88 } 88 }
89 } 89 }
90 90
91 pub fn snapshot( 91 pub fn analysis(
92 &self, 92 &self,
93 file_resolver: impl FileResolver, 93 file_resolver: impl FileResolver,
94 ) -> World { 94 ) -> Analysis {
95 World { 95 let imp = World {
96 needs_reindex: AtomicBool::new(false), 96 needs_reindex: AtomicBool::new(false),
97 file_resolver: Arc::new(file_resolver), 97 file_resolver: Arc::new(file_resolver),
98 data: self.data.clone() 98 data: self.data.clone()
99 } 99 };
100 } 100 Analysis { imp }
101
102 pub fn analysis(
103 &self,
104 file_resolver: impl FileResolver,
105 ) -> Analysis {
106 Analysis { imp: self.snapshot(file_resolver) }
107 } 101 }
108 102
109 pub fn change_file(&mut self, file_id: FileId, text: Option<String>) { 103 pub fn change_file(&mut self, file_id: FileId, text: Option<String>) {