// Find the calling expression and it's NameRef
let calling_node = FnCallNode::with_node(&syntax, position.offset)?;
let name_ref = calling_node.name_ref()?;
+ let name_ref = hir::Source::new(position.file_id.into(), name_ref.syntax());
- let analyzer = hir::SourceAnalyzer::new(
- db,
- hir::Source::new(position.file_id.into(), name_ref.syntax()),
- None,
- );
+ let analyzer = hir::SourceAnalyzer::new(db, name_ref, None);
let (mut call_info, has_self) = match &calling_node {
FnCallNode::CallExpr(expr) => {
- //FIXME: don't poke into Ty
- let (callable_def, _subst) = analyzer.type_of(db, &expr.expr()?)?.as_callable()?;
+ //FIXME: Type::as_callable is broken
+ let callable_def = analyzer.type_of(db, &expr.expr()?)?.as_callable()?;
match callable_def {
hir::CallableDef::FunctionId(it) => {
let fn_def = it.into();