aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_db/src/defs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_db/src/defs.rs')
-rw-r--r--crates/ra_ide_db/src/defs.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs
index 7cd2384e9..40d0e77b5 100644
--- a/crates/ra_ide_db/src/defs.rs
+++ b/crates/ra_ide_db/src/defs.rs
@@ -119,6 +119,16 @@ fn classify_name_inner(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Opti
119 119
120 match_ast! { 120 match_ast! {
121 match parent { 121 match parent {
122 ast::Alias(it) => {
123 tested_by!(goto_def_for_use_alias; force);
124 let use_tree = it.syntax().parent().and_then(ast::UseTree::cast)?;
125 let path = use_tree.path()?;
126 let path_segment = path.segment()?;
127 let name_ref = path_segment.name_ref()?;
128 let name_ref_class = classify_name_ref(sema, &name_ref)?;
129
130 Some(name_ref_class.definition())
131 },
122 ast::BindPat(it) => { 132 ast::BindPat(it) => {
123 let local = sema.to_def(&it)?; 133 let local = sema.to_def(&it)?;
124 Some(Definition::Local(local)) 134 Some(Definition::Local(local))