aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/goto_definition.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/goto_definition.rs')
-rw-r--r--crates/ra_ide_api/src/goto_definition.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs
index 332a2fb8d..f759f7339 100644
--- a/crates/ra_ide_api/src/goto_definition.rs
+++ b/crates/ra_ide_api/src/goto_definition.rs
@@ -48,7 +48,7 @@ pub(crate) fn reference_definition(
48) -> Cancelable<ReferenceResult> { 48) -> Cancelable<ReferenceResult> {
49 use self::ReferenceResult::*; 49 use self::ReferenceResult::*;
50 if let Some(function) = 50 if let Some(function) =
51 hir::source_binder::function_from_child_node(db, file_id, name_ref.syntax())? 51 hir::source_binder::function_from_child_node(db, file_id, name_ref.syntax())
52 { 52 {
53 let scope = function.scopes(db)?; 53 let scope = function.scopes(db)?;
54 // First try to resolve the symbol locally 54 // First try to resolve the symbol locally
@@ -77,8 +77,7 @@ pub(crate) fn reference_definition(
77 } 77 }
78 } 78 }
79 // Then try module name resolution 79 // Then try module name resolution
80 if let Some(module) = 80 if let Some(module) = hir::source_binder::module_from_child_node(db, file_id, name_ref.syntax())
81 hir::source_binder::module_from_child_node(db, file_id, name_ref.syntax())?
82 { 81 {
83 if let Some(path) = name_ref 82 if let Some(path) = name_ref
84 .syntax() 83 .syntax()
@@ -111,7 +110,7 @@ fn name_definition(
111 if let Some(module) = name.syntax().parent().and_then(ast::Module::cast) { 110 if let Some(module) = name.syntax().parent().and_then(ast::Module::cast) {
112 if module.has_semi() { 111 if module.has_semi() {
113 if let Some(child_module) = 112 if let Some(child_module) =
114 hir::source_binder::module_from_declaration(db, file_id, module)? 113 hir::source_binder::module_from_declaration(db, file_id, module)
115 { 114 {
116 let nav = NavigationTarget::from_module(db, child_module)?; 115 let nav = NavigationTarget::from_module(db, child_module)?;
117 return Ok(Some(vec![nav])); 116 return Ok(Some(vec![nav]));