diff options
Diffstat (limited to 'crates/ra_ide_api/src/imp.rs')
-rw-r--r-- | crates/ra_ide_api/src/imp.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/crates/ra_ide_api/src/imp.rs b/crates/ra_ide_api/src/imp.rs index 12bfe1761..ba4aa0fd5 100644 --- a/crates/ra_ide_api/src/imp.rs +++ b/crates/ra_ide_api/src/imp.rs | |||
@@ -15,7 +15,7 @@ use ra_syntax::{ | |||
15 | 15 | ||
16 | use crate::{ | 16 | use crate::{ |
17 | AnalysisChange, | 17 | AnalysisChange, |
18 | Cancelable, NavigationTarget, | 18 | Cancelable, |
19 | CrateId, db, Diagnostic, FileId, FilePosition, FileRange, FileSystemEdit, | 19 | CrateId, db, Diagnostic, FileId, FilePosition, FileRange, FileSystemEdit, |
20 | Query, RootChange, SourceChange, SourceFileEdit, | 20 | Query, RootChange, SourceChange, SourceFileEdit, |
21 | symbol_index::{LibrarySymbolsQuery, FileSymbol}, | 21 | symbol_index::{LibrarySymbolsQuery, FileSymbol}, |
@@ -98,19 +98,6 @@ impl db::RootDatabase { | |||
98 | } | 98 | } |
99 | 99 | ||
100 | impl db::RootDatabase { | 100 | impl db::RootDatabase { |
101 | /// This returns `Vec` because a module may be included from several places. We | ||
102 | /// don't handle this case yet though, so the Vec has length at most one. | ||
103 | pub(crate) fn parent_module( | ||
104 | &self, | ||
105 | position: FilePosition, | ||
106 | ) -> Cancelable<Vec<NavigationTarget>> { | ||
107 | let module = match source_binder::module_from_position(self, position)? { | ||
108 | None => return Ok(Vec::new()), | ||
109 | Some(it) => it, | ||
110 | }; | ||
111 | let nav = NavigationTarget::from_module(self, module)?; | ||
112 | Ok(vec![nav]) | ||
113 | } | ||
114 | /// Returns `Vec` for the same reason as `parent_module` | 101 | /// Returns `Vec` for the same reason as `parent_module` |
115 | pub(crate) fn crate_for(&self, file_id: FileId) -> Cancelable<Vec<CrateId>> { | 102 | pub(crate) fn crate_for(&self, file_id: FileId) -> Cancelable<Vec<CrateId>> { |
116 | let module = match source_binder::module_from_file_id(self, file_id)? { | 103 | let module = match source_binder::module_from_file_id(self, file_id)? { |