feat: Resolve builtin-attr and tools in ide layer

This commit is contained in:
Lukas Wirth 2021-12-03 16:32:14 +01:00
parent 4691a0647b
commit e58af219a4
15 changed files with 209 additions and 99 deletions

View file

@ -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;