From f320af4d63302d2933b37794826f705f13caf8a0 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 21 Jan 2020 00:06:47 +0800 Subject: Implement Syntax Highlight inside Macro --- crates/ra_ide/src/snapshots/highlighting.html | 10 ++++++++++ crates/ra_ide/src/snapshots/rainbow_highlighting.html | 12 ++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'crates/ra_ide/src/snapshots') diff --git a/crates/ra_ide/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html index 1d130544f..1cc55e78b 100644 --- a/crates/ra_ide/src/snapshots/highlighting.html +++ b/crates/ra_ide/src/snapshots/highlighting.html @@ -34,6 +34,16 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd foo::<i32>(); } +macro_rules! def_fn { + ($($tt:tt)*) => {$($tt)*} +} + +def_fn!{ + fn bar() -> u32 { + 100 + } +} + // comment fn main() { println!("Hello, {}!", 92); diff --git a/crates/ra_ide/src/snapshots/rainbow_highlighting.html b/crates/ra_ide/src/snapshots/rainbow_highlighting.html index d90ee8540..918fd4b97 100644 --- a/crates/ra_ide/src/snapshots/rainbow_highlighting.html +++ b/crates/ra_ide/src/snapshots/rainbow_highlighting.html @@ -24,14 +24,14 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd .keyword\.control { color: #F0DFAF; font-weight: bold; }
fn main() {
-    let hello = "hello";
-    let x = hello.to_string();
-    let y = hello.to_string();
+    let hello = "hello";
+    let x = hello.to_string();
+    let y = hello.to_string();
 
-    let x = "other color please!";
-    let y = x.to_string();
+    let x = "other color please!";
+    let y = x.to_string();
 }
 
 fn bar() {
-    let mut hello = "hello";
+    let mut hello = "hello";
 }
\ No newline at end of file -- cgit v1.2.3