mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Change ids strategy
this is a part of larghish hir refactoring which aims to * replace per-source-root module trees with per crate trees * switch from a monotyped DedId to type-specific ids
This commit is contained in:
parent
cfb085ded8
commit
3ab1519cb2
26 changed files with 365 additions and 430 deletions
|
@ -67,7 +67,7 @@ pub(crate) fn reference_definition(
|
|||
.node_expr(expr)
|
||||
.and_then(|it| infer_result.method_resolution(it))
|
||||
{
|
||||
if let Some(target) = NavigationTarget::from_def(db, def_id.resolve(db)) {
|
||||
if let Some(target) = NavigationTarget::from_def(db, hir::ModuleDef::Def(def_id)) {
|
||||
return Exact(target);
|
||||
}
|
||||
};
|
||||
|
@ -84,7 +84,7 @@ pub(crate) fn reference_definition(
|
|||
{
|
||||
let resolved = module.resolve_path(db, &path);
|
||||
if let Some(def_id) = resolved.take_types().or(resolved.take_values()) {
|
||||
if let Some(target) = NavigationTarget::from_def(db, def_id.resolve(db)) {
|
||||
if let Some(target) = NavigationTarget::from_def(db, def_id) {
|
||||
return Exact(target);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue