From 5534167f58ae81deabeffeffcc0ceb0e9c58b13f Mon Sep 17 00:00:00 2001 From: cynecx Date: Thu, 22 Aug 2019 00:39:18 +0200 Subject: Fix syntax-highlighting for fields (`NAMED_FIELD_DEF`) --- crates/ra_ide_api/src/syntax_highlighting.rs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'crates') diff --git a/crates/ra_ide_api/src/syntax_highlighting.rs b/crates/ra_ide_api/src/syntax_highlighting.rs index 878a94f06..448acffc8 100644 --- a/crates/ra_ide_api/src/syntax_highlighting.rs +++ b/crates/ra_ide_api/src/syntax_highlighting.rs @@ -158,21 +158,17 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec { + "type" + } + NAMED_FIELD_DEF => "field", + _ => "function", + }) + .unwrap_or("function") } } else { "text" -- cgit v1.2.3 From 1d87f85441fe8879be96952c7c39ff8b8d4bc880 Mon Sep 17 00:00:00 2001 From: cynecx Date: Thu, 22 Aug 2019 01:08:07 +0200 Subject: Update snapshots/highlighting.html to use correct highlighting --- crates/ra_ide_api/src/snapshots/highlighting.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates') diff --git a/crates/ra_ide_api/src/snapshots/highlighting.html b/crates/ra_ide_api/src/snapshots/highlighting.html index af7b4a0d0..b39c4d371 100644 --- a/crates/ra_ide_api/src/snapshots/highlighting.html +++ b/crates/ra_ide_api/src/snapshots/highlighting.html @@ -21,8 +21,8 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
#[derive(Clone, Debug)]
 struct Foo {
-    pub x: i32,
-    pub y: i32,
+    pub x: i32,
+    pub y: i32,
 }
 
 fn foo<T>() -> T {
-- 
cgit v1.2.3