update ide_api to new hir

This commit is contained in:
Aleksey Kladov 2019-01-24 15:40:52 +03:00
parent 1754dd9fdd
commit 2734636c53
5 changed files with 14 additions and 10 deletions

View file

@ -63,13 +63,11 @@ pub(crate) fn reference_definition(
let infer_result = function.infer(db);
let syntax_mapping = function.body_syntax_mapping(db);
let expr = ast::Expr::cast(method_call.syntax()).unwrap();
if let Some(def_id) = syntax_mapping
if let Some(func) = syntax_mapping
.node_expr(expr)
.and_then(|it| infer_result.method_resolution(it))
{
if let Some(target) = NavigationTarget::from_def(db, hir::ModuleDef::Def(def_id)) {
return Exact(target);
}
return Exact(NavigationTarget::from_function(db, func));
};
}
}