mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Simplify
This commit is contained in:
parent
9cb13b6efb
commit
634d588fd7
13 changed files with 137 additions and 176 deletions
|
@ -1,6 +1,6 @@
|
|||
//! Computes color for a single element.
|
||||
|
||||
use hir::{AsAssocItem, HasVisibility, HirFileIdExt, Semantics};
|
||||
use hir::{AsAssocItem, HasVisibility, MacroFileIdExt, Semantics};
|
||||
use ide_db::{
|
||||
defs::{Definition, IdentClass, NameClass, NameRefClass},
|
||||
FxHashMap, RootDatabase, SymbolKind,
|
||||
|
@ -218,7 +218,10 @@ fn highlight_name_ref(
|
|||
// We can fix this for derive attributes since derive helpers are recorded, but not for
|
||||
// general attributes.
|
||||
None if name_ref.syntax().ancestors().any(|it| it.kind() == ATTR)
|
||||
&& !sema.hir_file_for(name_ref.syntax()).is_derive_attr_pseudo_expansion(sema.db) =>
|
||||
&& !sema
|
||||
.hir_file_for(name_ref.syntax())
|
||||
.macro_file()
|
||||
.map_or(false, |it| it.is_derive_attr_pseudo_expansion(sema.db)) =>
|
||||
{
|
||||
return HlTag::Symbol(SymbolKind::Attribute).into();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue