File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 84
84
< span class ="keyword "> pub</ span > < span class ="keyword "> fn</ span > < span class ="function declaration "> foo</ span > (&< span class ="self_keyword "> self</ span > ) -> < span class ="builtin_type "> bool</ span > {
85
85
< span class ="bool_literal "> true</ span >
86
86
}
87
+ }
88
+
89
+ < span class ="comment documentation "> /// ```</ span >
90
+ < span class ="comment documentation "> /// </ span > < span class ="macro "> noop!</ span > (< span class ="numeric_literal "> 1</ span > );
91
+ < span class ="comment documentation "> /// ```</ span >
92
+ < span class ="macro "> macro_rules!</ span > < span class ="macro declaration "> noop</ span > {
93
+ ($expr:expr) => {
94
+ $expr
95
+ }
87
96
}</ code > </ pre >
Original file line number Diff line number Diff line change @@ -121,7 +121,6 @@ pub(crate) fn highlight(
121
121
assert ! ( current_macro_call == Some ( mc) ) ;
122
122
current_macro_call = None ;
123
123
format_string = None ;
124
- continue ;
125
124
}
126
125
_ => ( ) ,
127
126
}
@@ -150,7 +149,7 @@ pub(crate) fn highlight(
150
149
151
150
let range = element. text_range ( ) ;
152
151
153
- let element_to_highlight = if current_macro_call. is_some ( ) {
152
+ let element_to_highlight = if current_macro_call. is_some ( ) && element . kind ( ) != COMMENT {
154
153
// Inside a macro -- expand it first
155
154
let token = match element. clone ( ) . into_token ( ) {
156
155
Some ( it) if it. parent ( ) . kind ( ) == TOKEN_TREE => it,
Original file line number Diff line number Diff line change @@ -344,6 +344,15 @@ impl Foo {
344
344
true
345
345
}
346
346
}
347
+
348
+ /// ```
349
+ /// noop!(1);
350
+ /// ```
351
+ macro_rules! noop {
352
+ ($expr:expr) => {
353
+ $expr
354
+ }
355
+ }
347
356
"#
348
357
. trim ( ) ,
349
358
"crates/ra_ide/src/snapshots/highlight_doctest.html" ,
You can’t perform that action at this time.
0 commit comments