mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Add static semantic token modifier for associated functions with no &self
refactor logic into code_model.rs address comments
This commit is contained in:
parent
90031a267a
commit
6b950d24d4
2 changed files with 3 additions and 16 deletions
|
@ -6,7 +6,7 @@ pub(crate) mod tags;
|
|||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
use hir::{Local, Name, Semantics, VariantDef};
|
||||
use hir::{AsAssocItem, Local, Name, Semantics, VariantDef};
|
||||
use ide_db::{
|
||||
defs::{Definition, NameClass, NameRefClass},
|
||||
RootDatabase,
|
||||
|
@ -746,7 +746,7 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight {
|
|||
if func.is_unsafe(db) {
|
||||
h |= HighlightModifier::Unsafe;
|
||||
}
|
||||
if func.is_assoc_item(db) && func.self_param(db).is_none() {
|
||||
if func.as_assoc_item(db).is_some() && func.self_param(db).is_none() {
|
||||
h |= HighlightModifier::Static;
|
||||
}
|
||||
return h;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue