From 33832d43fcc10fd6da0edf004d575f3576d9e91d Mon Sep 17 00:00:00 2001 From: Leander Tentrup Date: Mon, 13 Jul 2020 22:59:42 +0200 Subject: Highlight punctuation as `HighlightTag::Operator` --- crates/ra_ide/src/syntax_highlighting.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index b3236e821..6067207d9 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs @@ -553,6 +553,7 @@ fn highlight_element( T![!] if element.parent().and_then(ast::MacroCall::cast).is_some() => { Highlight::new(HighlightTag::Macro) } + p if p.is_punct() => HighlightTag::Operator.into(), k if k.is_keyword() => { let h = Highlight::new(HighlightTag::Keyword); -- cgit v1.2.3 From 119e71d9ea6448c49f597af3e0afefa6bf0f12ac Mon Sep 17 00:00:00 2001 From: Leander Tentrup Date: Wed, 15 Jul 2020 16:34:11 +0200 Subject: Add new `Punctuation` highlight tag --- crates/ra_ide/src/syntax_highlighting.rs | 2 +- crates/ra_ide/src/syntax_highlighting/tags.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 6067207d9..6ac44c2c0 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs @@ -553,7 +553,7 @@ fn highlight_element( T![!] if element.parent().and_then(ast::MacroCall::cast).is_some() => { Highlight::new(HighlightTag::Macro) } - p if p.is_punct() => HighlightTag::Operator.into(), + p if p.is_punct() => HighlightTag::Punctuation.into(), k if k.is_keyword() => { let h = Highlight::new(HighlightTag::Keyword); diff --git a/crates/ra_ide/src/syntax_highlighting/tags.rs b/crates/ra_ide/src/syntax_highlighting/tags.rs index 719c6ed3c..49ec94bdc 100644 --- a/crates/ra_ide/src/syntax_highlighting/tags.rs +++ b/crates/ra_ide/src/syntax_highlighting/tags.rs @@ -32,6 +32,7 @@ pub enum HighlightTag { Macro, Module, NumericLiteral, + Punctuation, SelfKeyword, SelfType, Static, @@ -83,6 +84,7 @@ impl HighlightTag { HighlightTag::Generic => "generic", HighlightTag::Keyword => "keyword", HighlightTag::Lifetime => "lifetime", + HighlightTag::Punctuation => "punctuation", HighlightTag::Macro => "macro", HighlightTag::Module => "module", HighlightTag::NumericLiteral => "numeric_literal", -- cgit v1.2.3