From 11c0a5bb60f9377526a588c11c68d5471ae46aa3 Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Sun, 10 May 2020 16:08:28 +0100 Subject: Highlight mutable statics as mutable --- crates/ra_ide/src/snapshots/highlighting.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide/src/snapshots/highlighting.html') diff --git a/crates/ra_ide/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html index 4b12fe823..0a881d384 100644 --- a/crates/ra_ide/src/snapshots/highlighting.html +++ b/crates/ra_ide/src/snapshots/highlighting.html @@ -56,7 +56,10 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd let x = 92; vec.push(Foo { x, y: 1 }); } - unsafe { vec.set_len(0); } + unsafe { + vec.set_len(0); + STATIC_MUT = 1; + } let mut x = 42; let y = &mut x; -- cgit v1.2.3 From 22b75c4ceaefbaf26e63540b3e2d6705375c043c Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Sun, 10 May 2020 16:08:54 +0100 Subject: Highlight the name in macro declarations --- crates/ra_ide/src/snapshots/highlighting.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide/src/snapshots/highlighting.html') diff --git a/crates/ra_ide/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html index 0a881d384..4c27aade4 100644 --- a/crates/ra_ide/src/snapshots/highlighting.html +++ b/crates/ra_ide/src/snapshots/highlighting.html @@ -33,11 +33,13 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd pub y: i32, } +static mut STATIC_MUT: i32 = 0; + fn foo<'a, T>() -> T { foo::<'a, i32>() } -macro_rules! def_fn { +macro_rules! def_fn { ($($tt:tt)*) => {$($tt)*} } -- cgit v1.2.3 From 3f1c73633eb3e5d8a2df3a72dc772087cfb18be4 Mon Sep 17 00:00:00 2001 From: George Fraser Date: Sun, 10 May 2020 11:08:32 -0700 Subject: Color `in` as a control keyword --- crates/ra_ide/src/snapshots/highlighting.html | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/ra_ide/src/snapshots/highlighting.html') diff --git a/crates/ra_ide/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html index 4c27aade4..c67df5c39 100644 --- a/crates/ra_ide/src/snapshots/highlighting.html +++ b/crates/ra_ide/src/snapshots/highlighting.html @@ -63,6 +63,10 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd STATIC_MUT = 1; } + for e in vec { + // Do nothing + } + let mut x = 42; let y = &mut x; let z = &y; -- cgit v1.2.3 From 63b75a40c8c9e1f24fbd21c423f62f303281b77c Mon Sep 17 00:00:00 2001 From: George Fraser Date: Sun, 10 May 2020 11:26:19 -0700 Subject: Color `for` as a regular keyword when it's part of impl _ for _ --- crates/ra_ide/src/snapshots/highlighting.html | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crates/ra_ide/src/snapshots/highlighting.html') diff --git a/crates/ra_ide/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html index c67df5c39..635fe5cf9 100644 --- a/crates/ra_ide/src/snapshots/highlighting.html +++ b/crates/ra_ide/src/snapshots/highlighting.html @@ -33,6 +33,16 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd pub y: i32, } +trait Bar { + fn bar(&self) -> i32; +} + +impl Bar for Foo { + fn bar(&self) -> i32 { + self.x + } +} + static mut STATIC_MUT: i32 = 0; fn foo<'a, T>() -> T { -- cgit v1.2.3