mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
feat: Resolve builtin-attr and tools in ide layer
This commit is contained in:
parent
4691a0647b
commit
e58af219a4
15 changed files with 209 additions and 99 deletions
|
@ -115,8 +115,6 @@ impl Definition {
|
|||
Definition::Static(it) => name_range(it, sema),
|
||||
Definition::Trait(it) => name_range(it, sema),
|
||||
Definition::TypeAlias(it) => name_range(it, sema),
|
||||
Definition::BuiltinType(_) => return None,
|
||||
Definition::SelfType(_) => return None,
|
||||
Definition::Local(local) => {
|
||||
let src = local.source(sema.db);
|
||||
let name = match &src.value {
|
||||
|
@ -146,6 +144,10 @@ impl Definition {
|
|||
let lifetime = src.value.lifetime()?;
|
||||
src.with_value(lifetime.syntax()).original_file_range_opt(sema.db)
|
||||
}
|
||||
Definition::BuiltinType(_) => return None,
|
||||
Definition::SelfType(_) => return None,
|
||||
Definition::BuiltinAttr(_) => return None,
|
||||
Definition::Tool(_) => return None,
|
||||
};
|
||||
return res;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue