diff options
Diffstat (limited to 'crates/ra_ide_db/src/defs.rs')
-rw-r--r-- | crates/ra_ide_db/src/defs.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs index 7cd2384e9..54543e6e4 100644 --- a/crates/ra_ide_db/src/defs.rs +++ b/crates/ra_ide_db/src/defs.rs | |||
@@ -11,7 +11,7 @@ use hir::{ | |||
11 | }; | 11 | }; |
12 | use ra_prof::profile; | 12 | use ra_prof::profile; |
13 | use ra_syntax::{ | 13 | use ra_syntax::{ |
14 | ast::{self, AstNode}, | 14 | ast::{self, AstNode, NameOwner}, |
15 | match_ast, | 15 | match_ast, |
16 | }; | 16 | }; |
17 | use test_utils::tested_by; | 17 | use test_utils::tested_by; |
@@ -115,10 +115,16 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option | |||
115 | } | 115 | } |
116 | 116 | ||
117 | fn classify_name_inner(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option<Definition> { | 117 | fn classify_name_inner(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option<Definition> { |
118 | println!("name : {} -- {:?}", name, name); | ||
118 | let parent = name.syntax().parent()?; | 119 | let parent = name.syntax().parent()?; |
120 | println!("parent : {} -- {:?}", parent, parent); | ||
119 | 121 | ||
120 | match_ast! { | 122 | match_ast! { |
121 | match parent { | 123 | match parent { |
124 | ast::Alias(it) => { | ||
125 | let def = sema.to_def(&it)?; | ||
126 | Some(Definition::ModuleDef(def.into())) | ||
127 | }, | ||
122 | ast::BindPat(it) => { | 128 | ast::BindPat(it) => { |
123 | let local = sema.to_def(&it)?; | 129 | let local = sema.to_def(&it)?; |
124 | Some(Definition::Local(local)) | 130 | Some(Definition::Local(local)) |