mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Give ‘unsafe’ semantic token modifier to unsafe traits
This commit is contained in:
parent
57eedd9066
commit
4d4dbcfead
5 changed files with 20 additions and 3 deletions
|
@ -338,7 +338,14 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight {
|
|||
|
||||
return h;
|
||||
}
|
||||
hir::ModuleDef::Trait(_) => HlTag::Symbol(SymbolKind::Trait),
|
||||
hir::ModuleDef::Trait(trait_) => {
|
||||
let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Trait));
|
||||
|
||||
if trait_.is_unsafe(db) {
|
||||
h |= HlMod::Unsafe;
|
||||
}
|
||||
return h;
|
||||
}
|
||||
hir::ModuleDef::TypeAlias(type_) => {
|
||||
let mut h = Highlight::new(HlTag::Symbol(SymbolKind::TypeAlias));
|
||||
if let Some(item) = type_.as_assoc_item(db) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue