mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Classify name works for TypeParams
This commit is contained in:
parent
d1a01aa2f8
commit
7d2080a031
6 changed files with 68 additions and 5 deletions
|
@ -110,6 +110,15 @@ pub(crate) fn classify_name(db: &RootDatabase, name: InFile<&ast::Name>) -> Opti
|
|||
kind: NameKind::Macro(def),
|
||||
})
|
||||
},
|
||||
ast::TypeParam(it) => {
|
||||
let src = name.with_value(it);
|
||||
let def = hir::GenericParam::from_source(db, src)?;
|
||||
Some(NameDefinition {
|
||||
visibility: None,
|
||||
container: def.module(db),
|
||||
kind: NameKind::GenericParam(def),
|
||||
})
|
||||
},
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue