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.rs16
1 files changed, 2 insertions, 14 deletions
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs
index c28ff849a..3fcdb5e52 100644
--- a/crates/ide/src/syntax_highlighting.rs
+++ b/crates/ide/src/syntax_highlighting.rs
@@ -746,20 +746,8 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight {
746 if func.is_unsafe(db) { 746 if func.is_unsafe(db) {
747 h |= HighlightModifier::Unsafe; 747 h |= HighlightModifier::Unsafe;
748 } 748 }
749 if let None = func.self_param(db) { 749 if func.is_associated(db) {
750 // if enclosing IMPL or TRAIT exists, this is a static method 750 h |= HighlightModifier::Static;
751 let fn_parent_kind = func
752 .source(db)
753 .value
754 .syntax()
755 .parent()
756 .and_then(|s| s.parent())
757 .and_then(|s| Some(s.kind()));
758 if let Some(SyntaxKind::IMPL) = fn_parent_kind {
759 h |= HighlightModifier::Static;
760 } else if let Some(SyntaxKind::TRAIT) = fn_parent_kind {
761 h |= HighlightModifier::Static;
762 }
763 } 751 }
764 return h; 752 return h;
765 } 753 }