fix: Fix unresolved proc macro diagnostics pointing to macro expansions

This commit is contained in:
Lukas Wirth 2022-07-05 12:46:09 +02:00
parent ed44fe52e4
commit 976d07e53e
5 changed files with 63 additions and 41 deletions

View file

@ -239,14 +239,14 @@ impl Definition {
DefWithBody::Static(s) => s.source(db).map(|src| src.syntax().cloned()),
};
return match def {
Some(def) => SearchScope::file_range(def.as_ref().original_file_range_full(db)),
Some(def) => SearchScope::file_range(def.as_ref().original_file_range(db)),
None => SearchScope::single_file(file_id),
};
}
if let Definition::SelfType(impl_) = self {
return match impl_.source(db).map(|src| src.syntax().cloned()) {
Some(def) => SearchScope::file_range(def.as_ref().original_file_range_full(db)),
Some(def) => SearchScope::file_range(def.as_ref().original_file_range(db)),
None => SearchScope::single_file(file_id),
};
}
@ -262,7 +262,7 @@ impl Definition {
hir::GenericDef::Const(it) => it.source(db).map(|src| src.syntax().cloned()),
};
return match def {
Some(def) => SearchScope::file_range(def.as_ref().original_file_range_full(db)),
Some(def) => SearchScope::file_range(def.as_ref().original_file_range(db)),
None => SearchScope::single_file(file_id),
};
}