aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/tags.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-08 20:48:30 +0000
committerGitHub <[email protected]>2021-01-08 20:48:30 +0000
commit056cabf25d3ef7a96220f9f3a6f904b2841feab6 (patch)
treef2c780887fb41f87ef0872308501b09775275667 /crates/ide/src/syntax_highlighting/tags.rs
parent903d1f89a51254b92ae6d1776d118a32a38acdf6 (diff)
parente30c1c3fbf8f70336d985b2b73e5b0f45f3b95f5 (diff)
Merge #7212
7212: Simplify highlighting r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
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 {