aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_db
diff options
context:
space:
mode:
authorBenjamin Coenen <[email protected]>2020-05-01 15:26:22 +0100
committerBenjamin Coenen <[email protected]>2020-05-01 15:26:22 +0100
commit19e28888aa41b2845b47adb7314aed99d3c48679 (patch)
tree3ac50d956f87940df33fce9b9aa38ecc2b8b6780 /crates/ra_ide_db
parentc3c7edb9bc3f2860686383dc1498c988a56859e8 (diff)
wip
Signed-off-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'crates/ra_ide_db')
-rw-r--r--crates/ra_ide_db/src/defs.rs8
-rw-r--r--crates/ra_ide_db/src/marks.rs1
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};
12use ra_prof::profile; 12use ra_prof::profile;
13use ra_syntax::{ 13use ra_syntax::{
14 ast::{self, AstNode}, 14 ast::{self, AstNode, NameOwner},
15 match_ast, 15 match_ast,
16}; 16};
17use test_utils::tested_by; 17use test_utils::tested_by;
@@ -115,10 +115,16 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option
115} 115}
116 116
117fn classify_name_inner(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option<Definition> { 117fn 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
3test_utils::marks![ 3test_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