From 8000d1d30d0c6205585b12331124745aaf21c340 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 19 Aug 2020 20:02:33 +0200 Subject: [PATCH] Don't underline function definition if self is &mut The self is right there, and is already underlined, so it makes little sense to emit even more underlines. --- crates/ide/src/syntax_highlighting.rs | 6 ------ crates/ide/test_data/highlighting.html | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs index dd8cfe42d2d6..be88b2f9c32d 100644 --- a/crates/ide/src/syntax_highlighting.rs +++ b/crates/ide/src/syntax_highlighting.rs @@ -747,12 +747,6 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight { if func.is_unsafe(db) { h |= HighlightModifier::Unsafe; } - if let Some(self_param) = func.self_param(db) { - match self_param.access(db) { - hir::Access::Exclusive => h |= HighlightModifier::Mutable, - hir::Access::Shared | hir::Access::Owned => (), - } - } return h; } hir::ModuleDef::Adt(hir::Adt::Struct(_)) => HighlightTag::Struct, diff --git a/crates/ide/test_data/highlighting.html b/crates/ide/test_data/highlighting.html index a6b79589bf72..d0df2e0ec04b 100644 --- a/crates/ide/test_data/highlighting.html +++ b/crates/ide/test_data/highlighting.html @@ -65,7 +65,7 @@ self.x } - fn qux(&mut self) { + fn qux(&mut self) { self.x = 0; } @@ -84,7 +84,7 @@ self.x } - fn qux(&mut self) { + fn qux(&mut self) { self.x = 0; }