aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/tags.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-07 22:39:02 +0000
committerAleksey Kladov <[email protected]>2021-01-08 20:47:35 +0000
commite30c1c3fbf8f70336d985b2b73e5b0f45f3b95f5 (patch)
treea3cdc2d2f667ab5a122758152eb338a654d387cd /crates/ide/src/syntax_highlighting/tags.rs
parent981a0d708ec352969f9ca075a3e0e50c6da48197 (diff)
Simplify highlighting infra
This also fixes the killer whale bug
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tags.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/tags.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ide/src/syntax_highlighting/tags.rs b/crates/ide/src/syntax_highlighting/tags.rs
index 8b8867079..a0286b72d 100644
--- a/crates/ide/src/syntax_highlighting/tags.rs
+++ b/crates/ide/src/syntax_highlighting/tags.rs
@@ -94,13 +94,13 @@ impl HighlightTag {
94 HighlightTag::Comment => "comment", 94 HighlightTag::Comment => "comment",
95 HighlightTag::EscapeSequence => "escape_sequence", 95 HighlightTag::EscapeSequence => "escape_sequence",
96 HighlightTag::FormatSpecifier => "format_specifier", 96 HighlightTag::FormatSpecifier => "format_specifier",
97 HighlightTag::Dummy => "dummy",
98 HighlightTag::Keyword => "keyword", 97 HighlightTag::Keyword => "keyword",
99 HighlightTag::Punctuation => "punctuation", 98 HighlightTag::Punctuation => "punctuation",
100 HighlightTag::NumericLiteral => "numeric_literal", 99 HighlightTag::NumericLiteral => "numeric_literal",
101 HighlightTag::Operator => "operator", 100 HighlightTag::Operator => "operator",
102 HighlightTag::StringLiteral => "string_literal", 101 HighlightTag::StringLiteral => "string_literal",
103 HighlightTag::UnresolvedReference => "unresolved_reference", 102 HighlightTag::UnresolvedReference => "unresolved_reference",
103 HighlightTag::Dummy => "dummy",
104 } 104 }
105 } 105 }
106} 106}
@@ -173,6 +173,9 @@ impl Highlight {
173 pub(crate) fn new(tag: HighlightTag) -> Highlight { 173 pub(crate) fn new(tag: HighlightTag) -> Highlight {
174 Highlight { tag, modifiers: HighlightModifiers::default() } 174 Highlight { tag, modifiers: HighlightModifiers::default() }
175 } 175 }
176 pub fn is_empty(&self) -> bool {
177 self.tag == HighlightTag::Dummy && self.modifiers == HighlightModifiers::default()
178 }
176} 179}
177 180
178impl ops::BitOr<HighlightModifier> for HighlightTag { 181impl ops::BitOr<HighlightModifier> for HighlightTag {