From 5ca3855c06b6e28aaa99f5fdda41b6b80ed871b7 Mon Sep 17 00:00:00 2001 From: GrayJack Date: Mon, 20 Jul 2020 23:37:31 -0300 Subject: On second thought, we want to preserve the textMate here where all punctuation that are from a Attr be highlited as Attribute --- crates/ra_ide/src/syntax_highlighting.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide/src/syntax_highlighting.rs') diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 036180c60..d456d5d36 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs @@ -540,7 +540,6 @@ fn highlight_element( } } p if p.is_punct() => match p { - T![#] => HighlightTag::Attribute.into(), T![::] | T![->] | T![=>] | T![&] | T![..] | T![=] | T![@] => { HighlightTag::Operator.into() } @@ -581,6 +580,9 @@ fn highlight_element( _ if element.parent().and_then(ast::DotDotPat::cast).is_some() => { HighlightTag::Operator.into() } + _ if element.parent().and_then(ast::Attr::cast).is_some() => { + HighlightTag::Attribute.into() + } _ => HighlightTag::Punctuation.into(), }, -- cgit v1.2.3