mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Added mutable semantic token modifier for &mut self methods
This commit is contained in:
parent
617535393b
commit
336b81abd7
2 changed files with 9 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue