aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/highlight.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-26 10:39:15 +0100
committerGitHub <[email protected]>2021-04-26 10:39:15 +0100
commit3209ddacd5d2c070f917f8733d3df9415472c47f (patch)
tree2ea0d350587043554377b8becc73ca971099e566 /crates/ide/src/syntax_highlighting/highlight.rs
parent617535393bb5ccc7adf0bac8a3b9a9c306454e79 (diff)
parent421cf9a1bdd42c146c466f517e23104cd6fe27d4 (diff)
Merge #8660
8660: Added `mutable` semantic token modifier for `&mut self` methods r=Veykril a=1c3t3a This closes #8644. Co-authored-by: Bastian Kersting <[email protected]>
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..b586dcc17 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) {