mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
update ide_api to new hir
This commit is contained in:
parent
1754dd9fdd
commit
2734636c53
5 changed files with 14 additions and 10 deletions
|
@ -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));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue