From 18aa4bcb0328393db0c20de0241e1e9606901144 Mon Sep 17 00:00:00 2001 From: Roland Ruckerbauer Date: Fri, 29 May 2020 21:17:14 +0200 Subject: Add semantic highlight to QUESTION token Made it an operator with controlFlow modifier. --- crates/ra_ide/src/syntax_highlighting.rs | 1 + crates/ra_ide/src/syntax_highlighting/tags.rs | 2 ++ 2 files changed, 3 insertions(+) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 8a995d779..cd6464b40 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs @@ -391,6 +391,7 @@ fn highlight_element( INT_NUMBER | FLOAT_NUMBER => HighlightTag::NumericLiteral.into(), BYTE => HighlightTag::ByteLiteral.into(), CHAR => HighlightTag::CharLiteral.into(), + QUESTION => Highlight::new(HighlightTag::Operator) | HighlightModifier::ControlFlow, LIFETIME => { let h = Highlight::new(HighlightTag::Lifetime); match element.parent().map(|it| it.kind()) { diff --git a/crates/ra_ide/src/syntax_highlighting/tags.rs b/crates/ra_ide/src/syntax_highlighting/tags.rs index 46c718c91..1514531de 100644 --- a/crates/ra_ide/src/syntax_highlighting/tags.rs +++ b/crates/ra_ide/src/syntax_highlighting/tags.rs @@ -42,6 +42,7 @@ pub enum HighlightTag { Local, UnresolvedReference, FormatSpecifier, + Operator, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] @@ -89,6 +90,7 @@ impl HighlightTag { HighlightTag::Local => "variable", HighlightTag::UnresolvedReference => "unresolved_reference", HighlightTag::FormatSpecifier => "format_specifier", + HighlightTag::Operator => "operator", } } } -- cgit v1.2.3