diff options
Diffstat (limited to 'crates/libanalysis/src/lib.rs')
-rw-r--r-- | crates/libanalysis/src/lib.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/libanalysis/src/lib.rs b/crates/libanalysis/src/lib.rs index 810228632..c25d31f4b 100644 --- a/crates/libanalysis/src/lib.rs +++ b/crates/libanalysis/src/lib.rs | |||
@@ -12,6 +12,8 @@ mod symbol_index; | |||
12 | mod module_map; | 12 | mod module_map; |
13 | mod imp; | 13 | mod imp; |
14 | 14 | ||
15 | use std::sync::Arc; | ||
16 | |||
15 | use relative_path::{RelativePath, RelativePathBuf}; | 17 | use relative_path::{RelativePath, RelativePathBuf}; |
16 | use libsyntax2::{File, TextRange, TextUnit, AtomEdit}; | 18 | use libsyntax2::{File, TextRange, TextUnit, AtomEdit}; |
17 | use imp::{AnalysisImpl, AnalysisHostImpl}; | 19 | use imp::{AnalysisImpl, AnalysisHostImpl}; |
@@ -31,7 +33,7 @@ pub trait FileResolver: Send + Sync + 'static { | |||
31 | 33 | ||
32 | #[derive(Debug)] | 34 | #[derive(Debug)] |
33 | pub struct AnalysisHost { | 35 | pub struct AnalysisHost { |
34 | pub(crate) imp: AnalysisHostImpl | 36 | imp: AnalysisHostImpl |
35 | } | 37 | } |
36 | 38 | ||
37 | impl AnalysisHost { | 39 | impl AnalysisHost { |
@@ -39,7 +41,7 @@ impl AnalysisHost { | |||
39 | AnalysisHost { imp: AnalysisHostImpl::new() } | 41 | AnalysisHost { imp: AnalysisHostImpl::new() } |
40 | } | 42 | } |
41 | pub fn analysis(&self, file_resolver: impl FileResolver) -> Analysis { | 43 | pub fn analysis(&self, file_resolver: impl FileResolver) -> Analysis { |
42 | Analysis { imp: self.imp.analysis(file_resolver) } | 44 | Analysis { imp: self.imp.analysis(Arc::new(file_resolver)) } |
43 | } | 45 | } |
44 | pub fn change_file(&mut self, file_id: FileId, text: Option<String>) { | 46 | pub fn change_file(&mut self, file_id: FileId, text: Option<String>) { |
45 | self.change_files(::std::iter::once((file_id, text))); | 47 | self.change_files(::std::iter::once((file_id, text))); |
@@ -121,7 +123,7 @@ impl Query { | |||
121 | 123 | ||
122 | #[derive(Clone, Debug)] | 124 | #[derive(Clone, Debug)] |
123 | pub struct Analysis { | 125 | pub struct Analysis { |
124 | pub(crate) imp: AnalysisImpl | 126 | imp: AnalysisImpl |
125 | } | 127 | } |
126 | 128 | ||
127 | impl Analysis { | 129 | impl Analysis { |