diff options
author | Anatol Liu <[email protected]> | 2020-11-05 04:08:46 +0000 |
---|---|---|
committer | Anatol Liu <[email protected]> | 2020-11-09 21:09:20 +0000 |
commit | 6b950d24d44c6de4de3486832676359b2dfcb7c8 (patch) | |
tree | bee7396b4f0150a535cca971c8d5fd9969e96d77 /crates/ide/src | |
parent | 90031a267a2ea510cede2ab5c3164bb8605a69ac (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')
-rw-r--r-- | crates/ide/src/syntax_highlighting.rs | 4 |
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)] |
7 | mod tests; | 7 | mod tests; |
8 | 8 | ||
9 | use hir::{Local, Name, Semantics, VariantDef}; | 9 | use hir::{AsAssocItem, Local, Name, Semantics, VariantDef}; |
10 | use ide_db::{ | 10 | use 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; |