diff options
Diffstat (limited to 'crates/ra_analysis/src/descriptors')
-rw-r--r-- | crates/ra_analysis/src/descriptors/module/mod.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/mod.rs b/crates/ra_analysis/src/descriptors/module/mod.rs index a6eaec178..f5238e239 100644 --- a/crates/ra_analysis/src/descriptors/module/mod.rs +++ b/crates/ra_analysis/src/descriptors/module/mod.rs | |||
@@ -133,7 +133,15 @@ impl ModuleDescriptor { | |||
133 | Ok(res) | 133 | Ok(res) |
134 | } | 134 | } |
135 | 135 | ||
136 | pub(crate) fn resolve_path(&self, path: Path) -> Option<ModuleDescriptor> { | 136 | pub(crate) fn resolve_path(&self, path: Path) -> Cancelable<Option<ModuleDescriptor>> { |
137 | let res = match self.do_resolve_path(path) { | ||
138 | None => return Ok(None), | ||
139 | Some(it) => it, | ||
140 | }; | ||
141 | Ok(Some(res)) | ||
142 | } | ||
143 | |||
144 | fn do_resolve_path(&self, path: Path) -> Option<ModuleDescriptor> { | ||
137 | let mut curr = match path.kind { | 145 | let mut curr = match path.kind { |
138 | PathKind::Crate => self.crate_root(), | 146 | PathKind::Crate => self.crate_root(), |
139 | PathKind::Self_ | PathKind::Plain => self.clone(), | 147 | PathKind::Self_ | PathKind::Plain => self.clone(), |