diff options
Diffstat (limited to 'crates/ide/src/syntax_highlighting/highlight.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting/highlight.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs index 8dd5d801b..8cc877c1c 100644 --- a/crates/ide/src/syntax_highlighting/highlight.rs +++ b/crates/ide/src/syntax_highlighting/highlight.rs | |||
@@ -358,8 +358,18 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight { | |||
358 | hir::ModuleDef::Trait(_) => HlTag::Symbol(SymbolKind::Trait), | 358 | hir::ModuleDef::Trait(_) => HlTag::Symbol(SymbolKind::Trait), |
359 | hir::ModuleDef::TypeAlias(type_) => { | 359 | hir::ModuleDef::TypeAlias(type_) => { |
360 | let mut h = Highlight::new(HlTag::Symbol(SymbolKind::TypeAlias)); | 360 | let mut h = Highlight::new(HlTag::Symbol(SymbolKind::TypeAlias)); |
361 | if type_.as_assoc_item(db).is_some() { | 361 | if let Some(item) = type_.as_assoc_item(db) { |
362 | h |= HlMod::Associated | 362 | h |= HlMod::Associated; |
363 | match item.container(db) { | ||
364 | AssocItemContainer::Impl(i) => { | ||
365 | if i.trait_(db).is_some() { | ||
366 | h |= HlMod::Trait; | ||
367 | } | ||
368 | } | ||
369 | AssocItemContainer::Trait(_t) => { | ||
370 | h |= HlMod::Trait; | ||
371 | } | ||
372 | } | ||
363 | } | 373 | } |
364 | return h; | 374 | return h; |
365 | } | 375 | } |