diff options
Diffstat (limited to 'crates/ra_ide_db/src')
-rw-r--r-- | crates/ra_ide_db/src/defs.rs | 8 | ||||
-rw-r--r-- | crates/ra_ide_db/src/marks.rs | 1 |
2 files changed, 8 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)) |
diff --git a/crates/ra_ide_db/src/marks.rs b/crates/ra_ide_db/src/marks.rs index 03b4be21c..386fe605c 100644 --- a/crates/ra_ide_db/src/marks.rs +++ b/crates/ra_ide_db/src/marks.rs | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | test_utils::marks![ | 3 | test_utils::marks![ |
4 | goto_def_for_macros | 4 | goto_def_for_macros |
5 | goto_def_for_use_alias | ||
5 | goto_def_for_methods | 6 | goto_def_for_methods |
6 | goto_def_for_fields | 7 | goto_def_for_fields |
7 | goto_def_for_record_fields | 8 | goto_def_for_record_fields |