diff options
author | Edwin Cheng <[email protected]> | 2019-11-26 07:05:53 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-11-26 07:05:53 +0000 |
commit | 245a9b165acb179c40b8c9d4a085e5ccdd4b75d3 (patch) | |
tree | 8074ef35c99dd6345536e11f5fe030daebade95a /crates/ra_ide_api/src/call_info.rs | |
parent | 58a3b3b502580e9f49dcfc9b7223e8aec258adf6 (diff) |
Add hygiene information to SourceAnalyzer
Diffstat (limited to 'crates/ra_ide_api/src/call_info.rs')
-rw-r--r-- | crates/ra_ide_api/src/call_info.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/call_info.rs b/crates/ra_ide_api/src/call_info.rs index 9beceb29c..7ebdfc585 100644 --- a/crates/ra_ide_api/src/call_info.rs +++ b/crates/ra_ide_api/src/call_info.rs | |||
@@ -18,12 +18,9 @@ pub(crate) fn call_info(db: &RootDatabase, position: FilePosition) -> Option<Cal | |||
18 | // Find the calling expression and it's NameRef | 18 | // Find the calling expression and it's NameRef |
19 | let calling_node = FnCallNode::with_node(&syntax, position.offset)?; | 19 | let calling_node = FnCallNode::with_node(&syntax, position.offset)?; |
20 | let name_ref = calling_node.name_ref()?; | 20 | let name_ref = calling_node.name_ref()?; |
21 | let name_ref = hir::Source::new(position.file_id.into(), name_ref.syntax()); | ||
21 | 22 | ||
22 | let analyzer = hir::SourceAnalyzer::new( | 23 | let analyzer = hir::SourceAnalyzer::new(db, name_ref, None); |
23 | db, | ||
24 | hir::Source::new(position.file_id.into(), name_ref.syntax()), | ||
25 | None, | ||
26 | ); | ||
27 | let (mut call_info, has_self) = match &calling_node { | 24 | let (mut call_info, has_self) = match &calling_node { |
28 | FnCallNode::CallExpr(expr) => { | 25 | FnCallNode::CallExpr(expr) => { |
29 | //FIXME: don't poke into Ty | 26 | //FIXME: don't poke into Ty |
@@ -44,7 +41,7 @@ pub(crate) fn call_info(db: &RootDatabase, position: FilePosition) -> Option<Cal | |||
44 | (CallInfo::with_fn(db, function), function.has_self_param(db)) | 41 | (CallInfo::with_fn(db, function), function.has_self_param(db)) |
45 | } | 42 | } |
46 | FnCallNode::MacroCallExpr(expr) => { | 43 | FnCallNode::MacroCallExpr(expr) => { |
47 | let macro_def = analyzer.resolve_macro_call(db, &expr)?; | 44 | let macro_def = analyzer.resolve_macro_call(db, name_ref.with_value(&expr))?; |
48 | (CallInfo::with_macro(db, macro_def)?, false) | 45 | (CallInfo::with_macro(db, macro_def)?, false) |
49 | } | 46 | } |
50 | }; | 47 | }; |