diff options
author | Aramis Razzaghipour <[email protected]> | 2021-05-23 12:43:23 +0100 |
---|---|---|
committer | Aramis Razzaghipour <[email protected]> | 2021-05-23 12:45:10 +0100 |
commit | 4d4dbcfead82eb6af1f4ef781b197a6926788b15 (patch) | |
tree | 395729f98518d6f4ac5996d3cbfd4b65d04a85f1 /crates/ide/src/syntax_highlighting/highlight.rs | |
parent | 57eedd906688d6cfa332bd40bca5234043e7293e (diff) |
Give ‘unsafe’ semantic token modifier to unsafe traits
Diffstat (limited to 'crates/ide/src/syntax_highlighting/highlight.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting/highlight.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs index baed8e217..058e37ff0 100644 --- a/crates/ide/src/syntax_highlighting/highlight.rs +++ b/crates/ide/src/syntax_highlighting/highlight.rs | |||
@@ -338,7 +338,14 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight { | |||
338 | 338 | ||
339 | return h; | 339 | return h; |
340 | } | 340 | } |
341 | hir::ModuleDef::Trait(_) => HlTag::Symbol(SymbolKind::Trait), | 341 | hir::ModuleDef::Trait(trait_) => { |
342 | let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Trait)); | ||
343 | |||
344 | if trait_.is_unsafe(db) { | ||
345 | h |= HlMod::Unsafe; | ||
346 | } | ||
347 | return h; | ||
348 | } | ||
342 | hir::ModuleDef::TypeAlias(type_) => { | 349 | hir::ModuleDef::TypeAlias(type_) => { |
343 | let mut h = Highlight::new(HlTag::Symbol(SymbolKind::TypeAlias)); | 350 | let mut h = Highlight::new(HlTag::Symbol(SymbolKind::TypeAlias)); |
344 | if let Some(item) = type_.as_assoc_item(db) { | 351 | if let Some(item) = type_.as_assoc_item(db) { |