diff options
Diffstat (limited to 'crates/ra_analysis/src/lib.rs')
-rw-r--r-- | crates/ra_analysis/src/lib.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index 70ee448fc..0dac9f268 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs | |||
@@ -15,6 +15,7 @@ macro_rules! ctry { | |||
15 | mod db; | 15 | mod db; |
16 | mod imp; | 16 | mod imp; |
17 | mod completion; | 17 | mod completion; |
18 | mod goto_defenition; | ||
18 | mod symbol_index; | 19 | mod symbol_index; |
19 | pub mod mock_analysis; | 20 | pub mod mock_analysis; |
20 | mod runnables; | 21 | mod runnables; |
@@ -396,16 +397,15 @@ impl Analysis { | |||
396 | &self, | 397 | &self, |
397 | position: FilePosition, | 398 | position: FilePosition, |
398 | ) -> Cancelable<Option<Vec<NavigationTarget>>> { | 399 | ) -> Cancelable<Option<Vec<NavigationTarget>>> { |
399 | let r = self.approximately_resolve_symbol(position)?; | 400 | goto_defenition::goto_defenition(&*self.db, position) |
400 | Ok(r.map(|it| it.resolves_to)) | 401 | } |
401 | } | 402 | // /// Resolves reference to definition, but does not gurantee correctness. |
402 | /// Resolves reference to definition, but does not gurantee correctness. | 403 | // pub fn approximately_resolve_symbol( |
403 | pub fn approximately_resolve_symbol( | 404 | // &self, |
404 | &self, | 405 | // position: FilePosition, |
405 | position: FilePosition, | 406 | // ) -> Cancelable<Option<ReferenceResolution>> { |
406 | ) -> Cancelable<Option<ReferenceResolution>> { | 407 | // self.db.approximately_resolve_symbol(position) |
407 | self.db.approximately_resolve_symbol(position) | 408 | // } |
408 | } | ||
409 | /// Finds all usages of the reference at point. | 409 | /// Finds all usages of the reference at point. |
410 | pub fn find_all_refs(&self, position: FilePosition) -> Cancelable<Vec<(FileId, TextRange)>> { | 410 | pub fn find_all_refs(&self, position: FilePosition) -> Cancelable<Vec<(FileId, TextRange)>> { |
411 | self.db.find_all_refs(position) | 411 | self.db.find_all_refs(position) |