diff options
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index a67b1717a..3a135ef13 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -20,7 +20,7 @@ use crate::{ | |||
20 | descriptors::{FnDescriptor, ModuleTreeDescriptor, Problem}, | 20 | descriptors::{FnDescriptor, ModuleTreeDescriptor, Problem}, |
21 | roots::{ReadonlySourceRoot, SourceRoot, WritableSourceRoot}, | 21 | roots::{ReadonlySourceRoot, SourceRoot, WritableSourceRoot}, |
22 | CrateGraph, CrateId, Diagnostic, FileId, FileResolver, FileSystemEdit, JobToken, Position, | 22 | CrateGraph, CrateId, Diagnostic, FileId, FileResolver, FileSystemEdit, JobToken, Position, |
23 | Query, SourceChange, SourceFileEdit, | 23 | Query, SourceChange, SourceFileEdit, Cancelable, |
24 | }; | 24 | }; |
25 | 25 | ||
26 | #[derive(Clone, Debug)] | 26 | #[derive(Clone, Debug)] |
@@ -157,10 +157,10 @@ impl AnalysisImpl { | |||
157 | } | 157 | } |
158 | query.search(&buf, token) | 158 | query.search(&buf, token) |
159 | } | 159 | } |
160 | pub fn parent_module(&self, file_id: FileId) -> Vec<(FileId, FileSymbol)> { | 160 | pub fn parent_module(&self, file_id: FileId) -> Cancelable<Vec<(FileId, FileSymbol)>> { |
161 | let root = self.root(file_id); | 161 | let root = self.root(file_id); |
162 | let module_tree = root.module_tree(); | 162 | let module_tree = root.module_tree(); |
163 | module_tree | 163 | let res = module_tree |
164 | .parent_modules(file_id) | 164 | .parent_modules(file_id) |
165 | .iter() | 165 | .iter() |
166 | .map(|link| { | 166 | .map(|link| { |
@@ -174,7 +174,8 @@ impl AnalysisImpl { | |||
174 | }; | 174 | }; |
175 | (file_id, sym) | 175 | (file_id, sym) |
176 | }) | 176 | }) |
177 | .collect() | 177 | .collect(); |
178 | Ok(res) | ||
178 | } | 179 | } |
179 | pub fn crate_for(&self, file_id: FileId) -> Vec<CrateId> { | 180 | pub fn crate_for(&self, file_id: FileId) -> Vec<CrateId> { |
180 | let module_tree = self.root(file_id).module_tree(); | 181 | let module_tree = self.root(file_id).module_tree(); |