aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting.rs
diff options
context:
space:
mode:
authorAnatol Liu <[email protected]>2020-11-05 04:08:46 +0000
committerAnatol Liu <[email protected]>2020-11-09 21:09:20 +0000
commit6b950d24d44c6de4de3486832676359b2dfcb7c8 (patch)
treebee7396b4f0150a535cca971c8d5fd9969e96d77 /crates/ide/src/syntax_highlighting.rs
parent90031a267a2ea510cede2ab5c3164bb8605a69ac (diff)
Add static semantic token modifier for associated functions with no &self
refactor logic into code_model.rs address comments
Diffstat (limited to 'crates/ide/src/syntax_highlighting.rs')
-rw-r--r--crates/ide/src/syntax_highlighting.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs
index 41fd36edf..4a01097df 100644
--- a/crates/ide/src/syntax_highlighting.rs
+++ b/crates/ide/src/syntax_highlighting.rs
@@ -6,7 +6,7 @@ pub(crate) mod tags;
6#[cfg(test)] 6#[cfg(test)]
7mod tests; 7mod tests;
8 8
9use hir::{Local, Name, Semantics, VariantDef}; 9use hir::{AsAssocItem, Local, Name, Semantics, VariantDef};
10use ide_db::{ 10use ide_db::{
11 defs::{Definition, NameClass, NameRefClass}, 11 defs::{Definition, NameClass, NameRefClass},
12 RootDatabase, 12 RootDatabase,
@@ -746,7 +746,7 @@ 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 func.is_assoc_item(db) && func.self_param(db).is_none() { 749 if func.as_assoc_item(db).is_some() && func.self_param(db).is_none() {
750 h |= HighlightModifier::Static; 750 h |= HighlightModifier::Static;
751 } 751 }
752 return h; 752 return h;