aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/highlight.rs
diff options
context:
space:
mode:
authorBastian Kersting <[email protected]>2021-04-26 08:22:36 +0100
committerBastian Kersting <[email protected]>2021-04-26 08:24:18 +0100
commit336b81abd7e8d05caf72dbeab228e4e03b2c53ee (patch)
treed5d03260706c8aff193d97556f1e0420c76be9a4 /crates/ide/src/syntax_highlighting/highlight.rs
parent617535393bb5ccc7adf0bac8a3b9a9c306454e79 (diff)
Added mutable semantic token modifier for &mut self methods
Diffstat (limited to 'crates/ide/src/syntax_highlighting/highlight.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/highlight.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs
index 8731699dc..f80b8d9cc 100644
--- a/crates/ide/src/syntax_highlighting/highlight.rs
+++ b/crates/ide/src/syntax_highlighting/highlight.rs
@@ -286,8 +286,13 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight {
286 let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Function)); 286 let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Function));
287 if let Some(item) = func.as_assoc_item(db) { 287 if let Some(item) = func.as_assoc_item(db) {
288 h |= HlMod::Associated; 288 h |= HlMod::Associated;
289 if func.self_param(db).is_none() { 289 match func.self_param(db) {
290 h |= HlMod::Static 290 Some(sp) => {
291 if let hir::Access::Exclusive = sp.access(db) {
292 h |= HlMod::Mutable;
293 }
294 },
295 None => h |= HlMod::Static,
291 } 296 }
292 297
293 match item.container(db) { 298 match item.container(db) {