diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 036180c60a2..d456d5d362c 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(), }, diff --git a/crates/ra_ide/test_data/highlight_doctest.html b/crates/ra_ide/test_data/highlight_doctest.html index 78c2a30c3d9..6322d404fba 100644 --- a/crates/ra_ide/test_data/highlight_doctest.html +++ b/crates/ra_ide/test_data/highlight_doctest.html @@ -50,7 +50,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd /// # Examples /// /// ``` - /// # #![allow(unused_mut)] + /// # #![allow(unused_mut)] /// let mut foo: Foo = Foo::new(); /// ``` pub const fn new() -> Foo { diff --git a/crates/ra_ide/test_data/highlighting.html b/crates/ra_ide/test_data/highlighting.html index 182a3817a6b..345a2f0231f 100644 --- a/crates/ra_ide/test_data/highlighting.html +++ b/crates/ra_ide/test_data/highlighting.html @@ -35,7 +35,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd .unresolved_reference { color: #FC5555; text-decoration: wavy underline; } -
#[derive(Clone, Debug)]
+#[derive(Clone, Debug)]
struct Foo {
pub x: i32,
pub y: i32,