mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Highlight mutable statics as mutable
This commit is contained in:
parent
4578154b60
commit
11c0a5bb60
7 changed files with 56 additions and 13 deletions
|
@ -431,10 +431,16 @@ fn highlight_name(db: &RootDatabase, def: Definition) -> Highlight {
|
|||
hir::ModuleDef::Adt(hir::Adt::Union(_)) => HighlightTag::Union,
|
||||
hir::ModuleDef::EnumVariant(_) => HighlightTag::EnumVariant,
|
||||
hir::ModuleDef::Const(_) => HighlightTag::Constant,
|
||||
hir::ModuleDef::Static(_) => HighlightTag::Static,
|
||||
hir::ModuleDef::Trait(_) => HighlightTag::Trait,
|
||||
hir::ModuleDef::TypeAlias(_) => HighlightTag::TypeAlias,
|
||||
hir::ModuleDef::BuiltinType(_) => HighlightTag::BuiltinType,
|
||||
hir::ModuleDef::Static(s) => {
|
||||
let mut h = Highlight::new(HighlightTag::Static);
|
||||
if s.is_mut(db) {
|
||||
h |= HighlightModifier::Mutable;
|
||||
}
|
||||
return h;
|
||||
}
|
||||
},
|
||||
Definition::SelfType(_) => HighlightTag::SelfType,
|
||||
Definition::TypeParam(_) => HighlightTag::TypeParam,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue