aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/snapshots/highlighting.html
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-15 14:44:46 +0100
committerGitHub <[email protected]>2020-06-15 14:44:46 +0100
commit5b013e5665a34fd757fd6c48dc912606c0915b2c (patch)
tree413f268d2ba637089a84a91740d7599a0b611f49 /crates/ra_ide/src/snapshots/highlighting.html
parentd0ac2f746a7cd2282b2f672cd0a6650a8339b907 (diff)
parent06f89e5f3a00d91e84963745af989f1e9a906bb4 (diff)
Merge #4877
4877: Fix syntax highlighting of recursive macros r=matklad a=ltentrup Add syntax highlighting for the BANG (`!`) token if the parent is `MACRO_CALL`. Before: <img width="514" alt="before" src="https://user-images.githubusercontent.com/201808/84595030-11f65c00-ae56-11ea-9bb2-b1abe2236990.png"> After: <img width="516" alt="recursive-macro" src="https://user-images.githubusercontent.com/201808/84594981-d196de00-ae55-11ea-8636-f877d5d795ff.png"> Fixes #4694. Co-authored-by: Leander Tentrup <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/snapshots/highlighting.html')
-rw-r--r--crates/ra_ide/src/snapshots/highlighting.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/ra_ide/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html
index 33548d43c..5c2ff6ab5 100644
--- a/crates/ra_ide/src/snapshots/highlighting.html
+++ b/crates/ra_ide/src/snapshots/highlighting.html
@@ -62,6 +62,12 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
62 } 62 }
63} 63}
64 64
65<span class="macro">macro_rules!</span> <span class="macro declaration">noop</span> {
66 ($expr:expr) =&gt; {
67 $expr
68 }
69}
70
65<span class="comment">// comment</span> 71<span class="comment">// comment</span>
66<span class="keyword">fn</span> <span class="function declaration">main</span>() { 72<span class="keyword">fn</span> <span class="function declaration">main</span>() {
67 <span class="macro">println!</span>(<span class="string_literal">"Hello, {}!"</span>, <span class="numeric_literal">92</span>); 73 <span class="macro">println!</span>(<span class="string_literal">"Hello, {}!"</span>, <span class="numeric_literal">92</span>);
@@ -80,6 +86,8 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
80 <span class="comment">// Do nothing</span> 86 <span class="comment">// Do nothing</span>
81 } 87 }
82 88
89 <span class="macro">noop!</span>(<span class="macro">noop</span><span class="macro">!</span>(<span class="numeric_literal">1</span>));
90
83 <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable declaration mutable">x</span> = <span class="numeric_literal">42</span>; 91 <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable declaration mutable">x</span> = <span class="numeric_literal">42</span>;
84 <span class="keyword">let</span> <span class="variable declaration mutable">y</span> = &<span class="keyword">mut</span> <span class="variable mutable">x</span>; 92 <span class="keyword">let</span> <span class="variable declaration mutable">y</span> = &<span class="keyword">mut</span> <span class="variable mutable">x</span>;
85 <span class="keyword">let</span> <span class="variable declaration">z</span> = &<span class="variable mutable">y</span>; 93 <span class="keyword">let</span> <span class="variable declaration">z</span> = &<span class="variable mutable">y</span>;