8024: Added the trait modifier for assoc types.
This commit is contained in:
parent
51e5316de5
commit
4a9dd149aa
@ -323,8 +323,18 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight {
|
|||||||
hir::ModuleDef::Trait(_) => HlTag::Symbol(SymbolKind::Trait),
|
hir::ModuleDef::Trait(_) => HlTag::Symbol(SymbolKind::Trait),
|
||||||
hir::ModuleDef::TypeAlias(type_) => {
|
hir::ModuleDef::TypeAlias(type_) => {
|
||||||
let mut h = Highlight::new(HlTag::Symbol(SymbolKind::TypeAlias));
|
let mut h = Highlight::new(HlTag::Symbol(SymbolKind::TypeAlias));
|
||||||
if type_.as_assoc_item(db).is_some() {
|
if let Some(item) = type_.as_assoc_item(db) {
|
||||||
h |= HlMod::Associated
|
h |= HlMod::Associated;
|
||||||
|
match item.container(db) {
|
||||||
|
AssocItemContainer::Impl(i) => {
|
||||||
|
if i.trait_(db).is_some() {
|
||||||
|
h |= HlMod::Trait;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AssocItemContainer::Trait(_t) => {
|
||||||
|
h |= HlMod::Trait;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user