diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs index 866bba7d1b..3fd0748172 100644 --- a/crates/ide/src/syntax_highlighting/highlight.rs +++ b/crates/ide/src/syntax_highlighting/highlight.rs @@ -98,7 +98,7 @@ fn punctuation(sema: &Semantics, token: SyntaxToken, kind: SyntaxK } } (T![::] | T![->] | T![=>] | T![..] | T![=] | T![@] | T![.], _) => HlOperator::Other.into(), - (T![!], MACRO_CALL) => HlPunct::MacroBang.into(), + (T![!], MACRO_CALL | MACRO_RULES) => HlPunct::MacroBang.into(), (T![!], NEVER_TYPE) => HlTag::BuiltinType.into(), (T![!], PREFIX_EXPR) => HlOperator::Logical.into(), (T![*], PTR_TYPE) => HlTag::Keyword.into(), diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html index 36e9ec6333..a747b4bc1f 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html @@ -144,10 +144,10 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd } /// ``` -/// macro_rules! noop { ($expr:expr) => { $expr }} +/// macro_rules! noop { ($expr:expr) => { $expr }} /// noop!(1); /// ``` -macro_rules! noop { +macro_rules! noop { ($expr:expr) => { $expr } diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_keywords.html b/crates/ide/src/syntax_highlighting/test_data/highlight_keywords.html index 7cd6a5a72d..ba62b68e9d 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_keywords.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_keywords.html @@ -50,7 +50,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd use super::*; } -macro_rules! void { +macro_rules! void { ($($tt:tt)*) => {} } void!(Self); diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_macros.html b/crates/ide/src/syntax_highlighting/test_data/highlight_macros.html index 71add7e495..b725c80565 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_macros.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_macros.html @@ -48,7 +48,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd ,i32 :y pub } Foo struct } -macro_rules! def_fn { +macro_rules! def_fn { ($($tt:tt)*) => {$($tt)*} } @@ -58,17 +58,17 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd } } -macro_rules! dont_color_me_braces { +macro_rules! dont_color_me_braces { () => {0} } -macro_rules! noop { +macro_rules! noop { ($expr:expr) => { $expr } } -macro_rules! keyword_frag { +macro_rules! keyword_frag { ($type:ty) => ($type) } diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html b/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html index 29a0a9f066..60bc290121 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html @@ -42,20 +42,20 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd .unresolved_reference { color: #FC5555; text-decoration: wavy underline; } -
macro_rules! println {
+
macro_rules! println {
     ($($arg:tt)*) => ({
         $crate::io::_print($crate::format_args_nl!($($arg)*));
     })
 }
 #[rustc_builtin_macro]
 #[macro_export]
-macro_rules! format_args {}
+macro_rules! format_args {}
 #[rustc_builtin_macro]
 #[macro_export]
-macro_rules! const_format_args {}
+macro_rules! const_format_args {}
 #[rustc_builtin_macro]
 #[macro_export]
-macro_rules! format_args_nl {}
+macro_rules! format_args_nl {}
 
 mod panic {
     pub macro panic_2015 {
@@ -81,13 +81,13 @@ pre                 { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
 
 #[rustc_builtin_macro(std_panic)]
 #[macro_export]
-macro_rules! panic {}
+macro_rules! panic {}
 #[rustc_builtin_macro]
-macro_rules! assert {}
+macro_rules! assert {}
 #[rustc_builtin_macro]
-macro_rules! asm {}
+macro_rules! asm {}
 
-macro_rules! toho {
+macro_rules! toho {
     () => ($crate::panic!("not yet implemented"));
     ($($arg:tt)+) => ($crate::panic!("not yet implemented: {}", $crate::format_args!($($arg)+)));
 }
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html b/crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html
index 113463aa7a..0716bae751 100644
--- a/crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html
+++ b/crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html
@@ -42,12 +42,12 @@ pre                 { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
 
 .unresolved_reference { color: #FC5555; text-decoration: wavy underline; }
 
-
macro_rules! id {
+
macro_rules! id {
     ($($tt:tt)*) => {
         $($tt)*
     };
 }
-macro_rules! unsafe_deref {
+macro_rules! unsafe_deref {
     () => {
         *(&() as *const ())
     };