diff options
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tags.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting/tags.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/ide/src/syntax_highlighting/tags.rs b/crates/ide/src/syntax_highlighting/tags.rs index e07cfb43f..974f54fa0 100644 --- a/crates/ide/src/syntax_highlighting/tags.rs +++ b/crates/ide/src/syntax_highlighting/tags.rs | |||
@@ -51,12 +51,14 @@ pub enum HighlightModifier { | |||
51 | Injected, | 51 | Injected, |
52 | Mutable, | 52 | Mutable, |
53 | Consuming, | 53 | Consuming, |
54 | Unsafe, | ||
55 | Callable, | 54 | Callable, |
56 | /// Used for associated functions | 55 | /// Used for associated functions |
57 | Static, | 56 | Static, |
58 | /// Used for items in impls&traits. | 57 | /// Used for items in impls&traits. |
59 | Associated, | 58 | Associated, |
59 | |||
60 | /// Keep this last! | ||
61 | Unsafe, | ||
60 | } | 62 | } |
61 | 63 | ||
62 | impl HighlightTag { | 64 | impl HighlightTag { |
@@ -108,7 +110,7 @@ impl fmt::Display for HighlightTag { | |||
108 | } | 110 | } |
109 | 111 | ||
110 | impl HighlightModifier { | 112 | impl HighlightModifier { |
111 | const ALL: &'static [HighlightModifier] = &[ | 113 | const ALL: &'static [HighlightModifier; HighlightModifier::Unsafe as u8 as usize + 1] = &[ |
112 | HighlightModifier::Attribute, | 114 | HighlightModifier::Attribute, |
113 | HighlightModifier::ControlFlow, | 115 | HighlightModifier::ControlFlow, |
114 | HighlightModifier::Definition, | 116 | HighlightModifier::Definition, |
@@ -116,9 +118,10 @@ impl HighlightModifier { | |||
116 | HighlightModifier::Injected, | 118 | HighlightModifier::Injected, |
117 | HighlightModifier::Mutable, | 119 | HighlightModifier::Mutable, |
118 | HighlightModifier::Consuming, | 120 | HighlightModifier::Consuming, |
119 | HighlightModifier::Unsafe, | ||
120 | HighlightModifier::Callable, | 121 | HighlightModifier::Callable, |
121 | HighlightModifier::Static, | 122 | HighlightModifier::Static, |
123 | HighlightModifier::Associated, | ||
124 | HighlightModifier::Unsafe, | ||
122 | ]; | 125 | ]; |
123 | 126 | ||
124 | fn as_str(self) -> &'static str { | 127 | fn as_str(self) -> &'static str { |