diff options
Diffstat (limited to 'crates/ide/src/syntax_highlighting.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs index 9f864179e..efcc8ecfe 100644 --- a/crates/ide/src/syntax_highlighting.rs +++ b/crates/ide/src/syntax_highlighting.rs | |||
@@ -2,7 +2,7 @@ mod format; | |||
2 | mod html; | 2 | mod html; |
3 | mod injection; | 3 | mod injection; |
4 | mod macro_rules; | 4 | mod macro_rules; |
5 | mod tags; | 5 | pub(crate) mod tags; |
6 | #[cfg(test)] | 6 | #[cfg(test)] |
7 | mod tests; | 7 | mod tests; |
8 | 8 | ||
@@ -20,12 +20,13 @@ use syntax::{ | |||
20 | }; | 20 | }; |
21 | 21 | ||
22 | use crate::{ | 22 | use crate::{ |
23 | syntax_highlighting::{format::FormatStringHighlighter, macro_rules::MacroRulesHighlighter}, | 23 | syntax_highlighting::{ |
24 | FileId, | 24 | format::FormatStringHighlighter, macro_rules::MacroRulesHighlighter, tags::Highlight, |
25 | }, | ||
26 | FileId, HighlightModifier, HighlightTag, | ||
25 | }; | 27 | }; |
26 | 28 | ||
27 | pub(crate) use html::highlight_as_html; | 29 | pub(crate) use html::highlight_as_html; |
28 | pub use tags::{Highlight, HighlightModifier, HighlightModifiers, HighlightTag}; | ||
29 | 30 | ||
30 | #[derive(Debug, Clone)] | 31 | #[derive(Debug, Clone)] |
31 | pub struct HighlightedRange { | 32 | pub struct HighlightedRange { |
@@ -562,6 +563,9 @@ fn highlight_element( | |||
562 | T![!] if element.parent().and_then(ast::MacroCall::cast).is_some() => { | 563 | T![!] if element.parent().and_then(ast::MacroCall::cast).is_some() => { |
563 | HighlightTag::Macro.into() | 564 | HighlightTag::Macro.into() |
564 | } | 565 | } |
566 | T![!] if element.parent().and_then(ast::NeverType::cast).is_some() => { | ||
567 | HighlightTag::BuiltinType.into() | ||
568 | } | ||
565 | T![*] if element.parent().and_then(ast::PtrType::cast).is_some() => { | 569 | T![*] if element.parent().and_then(ast::PtrType::cast).is_some() => { |
566 | HighlightTag::Keyword.into() | 570 | HighlightTag::Keyword.into() |
567 | } | 571 | } |