aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_ide_api/src/call_info.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/crates/ra_ide_api/src/call_info.rs b/crates/ra_ide_api/src/call_info.rs
index e494f5620..3572825b5 100644
--- a/crates/ra_ide_api/src/call_info.rs
+++ b/crates/ra_ide_api/src/call_info.rs
@@ -4,7 +4,7 @@ use ra_db::SourceDatabase;
4use ra_syntax::{ 4use ra_syntax::{
5 algo::ancestors_at_offset, 5 algo::ancestors_at_offset,
6 ast::{self, ArgListOwner}, 6 ast::{self, ArgListOwner},
7 AstNode, SyntaxNode, TextUnit, 7 match_ast, AstNode, SyntaxNode, TextUnit,
8}; 8};
9use test_utils::tested_by; 9use test_utils::tested_by;
10 10
@@ -91,14 +91,13 @@ enum FnCallNode {
91impl FnCallNode { 91impl FnCallNode {
92 fn with_node(syntax: &SyntaxNode, offset: TextUnit) -> Option<FnCallNode> { 92 fn with_node(syntax: &SyntaxNode, offset: TextUnit) -> Option<FnCallNode> {
93 ancestors_at_offset(syntax, offset).find_map(|node| { 93 ancestors_at_offset(syntax, offset).find_map(|node| {
94 if let Some(expr) = ast::CallExpr::cast(node.clone()) { 94 match_ast! {
95 Some(FnCallNode::CallExpr(expr)) 95 match node {
96 } else if let Some(expr) = ast::MethodCallExpr::cast(node.clone()) { 96 ast::CallExpr(it) => { Some(FnCallNode::CallExpr(it)) },
97 Some(FnCallNode::MethodCallExpr(expr)) 97 ast::MethodCallExpr(it) => { Some(FnCallNode::MethodCallExpr(it)) },
98 } else if let Some(expr) = ast::MacroCall::cast(node) { 98 ast::MacroCall(it) => { Some(FnCallNode::MacroCallExpr(it)) },
99 Some(FnCallNode::MacroCallExpr(expr)) 99 _ => { None },
100 } else { 100 }
101 None
102 } 101 }
103 }) 102 })
104 } 103 }