Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/syntax_highlighting/highlight.rs')
| -rw-r--r-- | crates/ide/src/syntax_highlighting/highlight.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs index 34c4ccd4c7..a5be905983 100644 --- a/crates/ide/src/syntax_highlighting/highlight.rs +++ b/crates/ide/src/syntax_highlighting/highlight.rs @@ -133,7 +133,7 @@ fn token( _ if parent_matches::<ast::RangeExpr>(&token) => HlOperator::Other.into(), _ if parent_matches::<ast::RangePat>(&token) => HlOperator::Other.into(), _ if parent_matches::<ast::RestPat>(&token) => HlOperator::Other.into(), - _ if parent_matches::<ast::Attr>(&token) => HlTag::Attribute.into(), + _ if parent_matches::<ast::Attr>(&token) => HlTag::AttributeBracket.into(), kind => match kind { T!['['] | T![']'] => HlPunct::Bracket, T!['{'] | T!['}'] => HlPunct::Brace, @@ -200,7 +200,7 @@ fn node( return None; }, ast::Attr(__) => { - HlTag::Attribute.into() + HlTag::AttributeBracket.into() }, // Highlight definitions depending on the "type" of the definition. ast::Name(name) => { @@ -374,7 +374,13 @@ fn highlight_def( ) -> Highlight { let db = sema.db; let mut h = match def { - Definition::Macro(_) => Highlight::new(HlTag::Symbol(SymbolKind::Macro)), + Definition::Macro(m) => Highlight::new(HlTag::Symbol(match m.kind() { + hir::MacroKind::Declarative | hir::MacroKind::BuiltIn | hir::MacroKind::ProcMacro => { + SymbolKind::Macro + } + hir::MacroKind::Derive => SymbolKind::Derive, + hir::MacroKind::Attr => SymbolKind::Attribute, + })), Definition::Field(_) => Highlight::new(HlTag::Symbol(SymbolKind::Field)), Definition::Module(module) => { let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Module)); |