diff --git a/crates/ra_ide_api/src/snapshots/highlighting.html b/crates/ra_ide_api/src/snapshots/highlighting.html index ae30ebba383d..b39c4d3717a7 100644 --- a/crates/ra_ide_api/src/snapshots/highlighting.html +++ b/crates/ra_ide_api/src/snapshots/highlighting.html @@ -19,7 +19,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd .keyword\.unsafe { color: #DFAF8F; } .keyword\.control { color: #F0DFAF; font-weight: bold; } -
#[derive(Clone, Debug)]
+#[derive(Clone, Debug)]
struct Foo {
pub x: i32,
pub y: i32,
diff --git a/crates/ra_ide_api/src/syntax_highlighting.rs b/crates/ra_ide_api/src/syntax_highlighting.rs
index 9ae2dc0610e5..1d290387c418 100644
--- a/crates/ra_ide_api/src/syntax_highlighting.rs
+++ b/crates/ra_ide_api/src/syntax_highlighting.rs
@@ -97,6 +97,9 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec "string",
ATTR => "attribute",
NAME_REF => {
+ if node.ancestors().any(|it| it.kind() == ATTR) {
+ continue;
+ }
if let Some(name_ref) = node.as_node().cloned().and_then(ast::NameRef::cast) {
// FIXME: try to reuse the SourceAnalyzers
let analyzer = hir::SourceAnalyzer::new(db, file_id, name_ref.syntax(), None);