aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-25 13:34:12 +0000
committerGitHub <[email protected]>2019-11-25 13:34:12 +0000
commitdf25dd4d882d7521140458b60f486c2f617608ee (patch)
tree0f1ec63bc811d36bd3b910c33d23607e40571160 /crates/ra_ide_api/src
parent69fa6403d56f44d8351727b8993fbee5e6189b97 (diff)
parent78791d6fac1ff426264e636545a07664d83d2039 (diff)
Merge #2402
2402: Use ids for Callable r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r--crates/ra_ide_api/src/call_info.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/crates/ra_ide_api/src/call_info.rs b/crates/ra_ide_api/src/call_info.rs
index 7c367230e..9beceb29c 100644
--- a/crates/ra_ide_api/src/call_info.rs
+++ b/crates/ra_ide_api/src/call_info.rs
@@ -26,14 +26,17 @@ pub(crate) fn call_info(db: &RootDatabase, position: FilePosition) -> Option<Cal
26 ); 26 );
27 let (mut call_info, has_self) = match &calling_node { 27 let (mut call_info, has_self) = match &calling_node {
28 FnCallNode::CallExpr(expr) => { 28 FnCallNode::CallExpr(expr) => {
29 //FIXME: apply subst 29 //FIXME: don't poke into Ty
30 let (callable_def, _subst) = analyzer.type_of(db, &expr.expr()?)?.as_callable()?; 30 let (callable_def, _subst) = analyzer.type_of(db, &expr.expr()?)?.as_callable()?;
31 match callable_def { 31 match callable_def {
32 hir::CallableDef::Function(it) => { 32 hir::CallableDef::FunctionId(it) => {
33 (CallInfo::with_fn(db, it), it.has_self_param(db)) 33 let fn_def = it.into();
34 (CallInfo::with_fn(db, fn_def), fn_def.has_self_param(db))
35 }
36 hir::CallableDef::StructId(it) => (CallInfo::with_struct(db, it.into())?, false),
37 hir::CallableDef::EnumVariantId(it) => {
38 (CallInfo::with_enum_variant(db, it.into())?, false)
34 } 39 }
35 hir::CallableDef::Struct(it) => (CallInfo::with_struct(db, it)?, false),
36 hir::CallableDef::EnumVariant(it) => (CallInfo::with_enum_variant(db, it)?, false),
37 } 40 }
38 } 41 }
39 FnCallNode::MethodCallExpr(expr) => { 42 FnCallNode::MethodCallExpr(expr) => {