Added mutable semantic token modifier for &mut self methods

This commit is contained in:
Bastian Kersting 2021-04-26 09:22:36 +02:00
parent 617535393b
commit 336b81abd7
2 changed files with 9 additions and 4 deletions

View file

@ -286,8 +286,13 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight {
let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Function));
if let Some(item) = func.as_assoc_item(db) {
h |= HlMod::Associated;
if func.self_param(db).is_none() {
h |= HlMod::Static
match func.self_param(db) {
Some(sp) => {
if let hir::Access::Exclusive = sp.access(db) {
h |= HlMod::Mutable;
}
},
None => h |= HlMod::Static,
}
match item.container(db) {