aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/syntax_highlighting.rs')
-rw-r--r--crates/ide/src/syntax_highlighting.rs20
1 files changed, 8 insertions, 12 deletions
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs
index 9827c68af..fc4f56550 100644
--- a/crates/ide/src/syntax_highlighting.rs
+++ b/crates/ide/src/syntax_highlighting.rs
@@ -4,7 +4,7 @@ mod injection;
4#[cfg(test)] 4#[cfg(test)]
5mod tests; 5mod tests;
6 6
7use hir::{Mutability, Name, SelfKind, Semantics, VariantDef}; 7use hir::{Name, SelfKind, Semantics, VariantDef};
8use ide_db::{ 8use ide_db::{
9 defs::{classify_name, classify_name_ref, Definition, NameClass, NameRefClass}, 9 defs::{classify_name, classify_name_ref, Definition, NameClass, NameRefClass},
10 RootDatabase, 10 RootDatabase,
@@ -761,17 +761,13 @@ fn highlight_name(
761 h |= HighlightModifier::Unsafe; 761 h |= HighlightModifier::Unsafe;
762 } 762 }
763 763
764 return if func.has_self_param(db) { 764 match func.self_param(db) {
765 match func.mutability_of_self_param(db) { 765 None => h,
766 Some(mutability) => match mutability { 766 Some(self_param) => match self_param.access(db) {
767 Mutability::Mut => h | HighlightModifier::Mutable, 767 hir::Access::Exclusive => h | HighlightModifier::Mutable,
768 Mutability::Shared => h, 768 hir::Access::Shared | hir::Access::Owned => h,
769 }, 769 },
770 None => h, 770 }
771 }
772 } else {
773 h
774 };
775 }); 771 });
776 } 772 }
777 hir::ModuleDef::Adt(hir::Adt::Struct(_)) => HighlightTag::Struct, 773 hir::ModuleDef::Adt(hir::Adt::Struct(_)) => HighlightTag::Struct,