From 336b81abd7e8d05caf72dbeab228e4e03b2c53ee Mon Sep 17 00:00:00 2001 From: Bastian Kersting Date: Mon, 26 Apr 2021 09:22:36 +0200 Subject: Added mutable semantic token modifier for &mut self methods --- crates/ide/src/syntax_highlighting/highlight.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crates/ide/src/syntax_highlighting/highlight.rs') 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 { 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) { -- cgit v1.2.3