aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/macro_rules.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-09 13:09:15 +0000
committerGitHub <[email protected]>2021-01-09 13:09:15 +0000
commit939ca83b34f9a5648d196f85e5cc7d844ba22604 (patch)
treea007952a8870e4d8c0b5fa1e0e0a088b399a8c8d /crates/ide/src/syntax_highlighting/macro_rules.rs
parent625ec9e1ae69168f194cbc5bf20846870f03e149 (diff)
parent4a8d2c098d88da6f36f3cf95f424b471987c5daa (diff)
Merge #7216
7216: Highlighting improvements r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ide/src/syntax_highlighting/macro_rules.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/macro_rules.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ide/src/syntax_highlighting/macro_rules.rs b/crates/ide/src/syntax_highlighting/macro_rules.rs
index 4462af47e..21d8a9835 100644
--- a/crates/ide/src/syntax_highlighting/macro_rules.rs
+++ b/crates/ide/src/syntax_highlighting/macro_rules.rs
@@ -1,7 +1,7 @@
1//! Syntax highlighting for macro_rules!. 1//! Syntax highlighting for macro_rules!.
2use syntax::{SyntaxElement, SyntaxKind, SyntaxToken, TextRange, T}; 2use syntax::{SyntaxElement, SyntaxKind, SyntaxToken, TextRange, T};
3 3
4use crate::{HighlightTag, HighlightedRange}; 4use crate::{HlRange, HlTag};
5 5
6#[derive(Default)] 6#[derive(Default)]
7pub(super) struct MacroRulesHighlighter { 7pub(super) struct MacroRulesHighlighter {
@@ -19,13 +19,13 @@ impl MacroRulesHighlighter {
19 } 19 }
20 } 20 }
21 21
22 pub(super) fn highlight(&self, element: SyntaxElement) -> Option<HighlightedRange> { 22 pub(super) fn highlight(&self, element: SyntaxElement) -> Option<HlRange> {
23 if let Some(state) = self.state.as_ref() { 23 if let Some(state) = self.state.as_ref() {
24 if matches!(state.rule_state, RuleState::Matcher | RuleState::Expander) { 24 if matches!(state.rule_state, RuleState::Matcher | RuleState::Expander) {
25 if let Some(range) = is_metavariable(element) { 25 if let Some(range) = is_metavariable(element) {
26 return Some(HighlightedRange { 26 return Some(HlRange {
27 range, 27 range,
28 highlight: HighlightTag::UnresolvedReference.into(), 28 highlight: HlTag::UnresolvedReference.into(),
29 binding_hash: None, 29 binding_hash: None,
30 }); 30 });
31 } 31 }