diff options
Diffstat (limited to 'crates/ra_analysis/src/lib.rs')
-rw-r--r-- | crates/ra_analysis/src/lib.rs | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index 849fd93e4..d8b355a81 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs | |||
@@ -19,7 +19,6 @@ mod imp; | |||
19 | mod job; | 19 | mod job; |
20 | mod roots; | 20 | mod roots; |
21 | mod db; | 21 | mod db; |
22 | mod queries; | ||
23 | mod descriptors; | 22 | mod descriptors; |
24 | 23 | ||
25 | use std::{ | 24 | use std::{ |
@@ -29,15 +28,18 @@ use std::{ | |||
29 | 28 | ||
30 | use relative_path::{RelativePath, RelativePathBuf}; | 29 | use relative_path::{RelativePath, RelativePathBuf}; |
31 | use ra_syntax::{File, TextRange, TextUnit, AtomEdit}; | 30 | use ra_syntax::{File, TextRange, TextUnit, AtomEdit}; |
32 | use imp::{AnalysisImpl, AnalysisHostImpl, FileResolverImp}; | ||
33 | use rustc_hash::FxHashMap; | 31 | use rustc_hash::FxHashMap; |
32 | use crate::imp::{AnalysisImpl, AnalysisHostImpl, FileResolverImp}; | ||
34 | 33 | ||
35 | pub use ra_editor::{ | 34 | pub use ra_editor::{ |
36 | StructureNode, LineIndex, FileSymbol, | 35 | StructureNode, LineIndex, FileSymbol, |
37 | Runnable, RunnableKind, HighlightedRange, CompletionItem, | 36 | Runnable, RunnableKind, HighlightedRange, CompletionItem, |
38 | Fold, FoldKind | 37 | Fold, FoldKind |
39 | }; | 38 | }; |
40 | pub use job::{JobToken, JobHandle}; | 39 | pub use crate::{ |
40 | job::{JobToken, JobHandle}, | ||
41 | descriptors::FnDescriptor, | ||
42 | }; | ||
41 | 43 | ||
42 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] | 44 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] |
43 | pub struct FileId(pub u32); | 45 | pub struct FileId(pub u32); |
@@ -159,7 +161,7 @@ impl Query { | |||
159 | } | 161 | } |
160 | } | 162 | } |
161 | 163 | ||
162 | #[derive(Clone, Debug)] | 164 | #[derive(Debug)] |
163 | pub struct Analysis { | 165 | pub struct Analysis { |
164 | imp: AnalysisImpl | 166 | imp: AnalysisImpl |
165 | } | 167 | } |
@@ -236,6 +238,11 @@ impl Analysis { | |||
236 | let file = self.imp.file_syntax(file_id); | 238 | let file = self.imp.file_syntax(file_id); |
237 | ra_editor::folding_ranges(&file) | 239 | ra_editor::folding_ranges(&file) |
238 | } | 240 | } |
241 | |||
242 | pub fn resolve_callable(&self, file_id: FileId, offset: TextUnit, token: &JobToken) | ||
243 | -> Option<(FnDescriptor, Option<usize>)> { | ||
244 | self.imp.resolve_callable(file_id, offset, token) | ||
245 | } | ||
239 | } | 246 | } |
240 | 247 | ||
241 | #[derive(Debug)] | 248 | #[derive(Debug)] |
@@ -250,3 +257,9 @@ impl LibraryData { | |||
250 | LibraryData { root } | 257 | LibraryData { root } |
251 | } | 258 | } |
252 | } | 259 | } |
260 | |||
261 | #[test] | ||
262 | fn analysis_is_send() { | ||
263 | fn is_send<T: Send>() {} | ||
264 | is_send::<Analysis>(); | ||
265 | } | ||