aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/snapshots/highlighting.html
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/snapshots/highlighting.html')
-rw-r--r--crates/ra_ide/src/snapshots/highlighting.html74
1 files changed, 41 insertions, 33 deletions
diff --git a/crates/ra_ide/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html
index a02dbaf2f..495b07f69 100644
--- a/crates/ra_ide/src/snapshots/highlighting.html
+++ b/crates/ra_ide/src/snapshots/highlighting.html
@@ -3,70 +3,78 @@
3body { margin: 0; } 3body { margin: 0; }
4pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padding: 0.4em; } 4pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padding: 0.4em; }
5 5
6.lifetime { color: #DFAF8F; font-style: italic; }
6.comment { color: #7F9F7F; } 7.comment { color: #7F9F7F; }
7.string { color: #CC9393; } 8.struct, .enum { color: #7CB8BB; }
9.enum_variant { color: #BDE0F3; }
10.string_literal { color: #CC9393; }
8.field { color: #94BFF3; } 11.field { color: #94BFF3; }
9.function { color: #93E0E3; } 12.function { color: #93E0E3; }
10.parameter { color: #94BFF3; } 13.parameter { color: #94BFF3; }
11.text { color: #DCDCCC; } 14.text { color: #DCDCCC; }
12.type { color: #7CB8BB; } 15.type { color: #7CB8BB; }
13.type\.builtin { color: #8CD0D3; } 16.builtin_type { color: #8CD0D3; }
14.type\.param { color: #20999D; } 17.type_param { color: #DFAF8F; }
15.attribute { color: #94BFF3; } 18.attribute { color: #94BFF3; }
16.literal { color: #BFEBBF; } 19.numeric_literal { color: #BFEBBF; }
17.literal\.numeric { color: #6A8759; }
18.macro { color: #94BFF3; } 20.macro { color: #94BFF3; }
19.module { color: #AFD8AF; } 21.module { color: #AFD8AF; }
20.variable { color: #DCDCCC; } 22.variable { color: #DCDCCC; }
21.variable\.mut { color: #DCDCCC; text-decoration: underline; } 23.mutable { text-decoration: underline; }
22 24
23.keyword { color: #F0DFAF; } 25.keyword { color: #F0DFAF; font-weight: bold; }
24.keyword\.unsafe { color: #DFAF8F; } 26.keyword.unsafe { color: #BC8383; font-weight: bold; }
25.keyword\.control { color: #F0DFAF; font-weight: bold; } 27.control { font-style: italic; }
26</style> 28</style>
27<pre><code><span class="attribute">#</span><span class="attribute">[</span><span class="attribute">derive</span><span class="attribute">(</span><span class="attribute">Clone</span><span class="attribute">,</span><span class="attribute"> </span><span class="attribute">Debug</span><span class="attribute">)</span><span class="attribute">]</span> 29<pre><code><span class="attribute">#</span><span class="attribute">[</span><span class="attribute">derive</span><span class="attribute">(</span><span class="attribute">Clone</span><span class="attribute">,</span><span class="attribute"> </span><span class="attribute">Debug</span><span class="attribute">)</span><span class="attribute">]</span>
28<span class="keyword">struct</span> <span class="type">Foo</span> { 30<span class="keyword">struct</span> <span class="struct declaration">Foo</span> {
29 <span class="keyword">pub</span> <span class="field">x</span>: <span class="type.builtin">i32</span>, 31 <span class="keyword">pub</span> <span class="field declaration">x</span>: <span class="builtin_type">i32</span>,
30 <span class="keyword">pub</span> <span class="field">y</span>: <span class="type.builtin">i32</span>, 32 <span class="keyword">pub</span> <span class="field declaration">y</span>: <span class="builtin_type">i32</span>,
31} 33}
32 34
33<span class="keyword">fn</span> <span class="function">foo</span>&lt;<span class="type.param">T</span>&gt;() -&gt; <span class="type.param">T</span> { 35<span class="keyword">fn</span> <span class="function declaration">foo</span>&lt;<span class="lifetime declaration">'a</span>, <span class="type_param declaration">T</span>&gt;() -&gt; <span class="type_param">T</span> {
34 <span class="macro">unimplemented</span><span class="macro">!</span>(); 36 <span class="function">foo</span>::&lt;<span class="lifetime">'a</span>, <span class="builtin_type">i32</span>&gt;()
35 <span class="function">foo</span>::&lt;<span class="type.builtin">i32</span>&gt;();
36} 37}
37 38
38<span class="macro">macro_rules</span><span class="macro">!</span> def_fn { 39<span class="macro">macro_rules</span><span class="macro">!</span> def_fn {
39 ($($tt:tt)*) =&gt; {$($tt)*} 40 ($($tt:tt)*) =&gt; {$($tt)*}
40} 41}
41 42
42<span class="macro">def_fn</span><span class="macro">!</span>{ 43<span class="macro">def_fn</span><span class="macro">!</span> {
43 <span class="keyword">fn</span> <span class="function">bar</span>() -&gt; <span class="type.builtin">u32</span> { 44 <span class="keyword">fn</span> <span class="function declaration">bar</span>() -&gt; <span class="builtin_type">u32</span> {
44 <span class="literal.numeric">100</span> 45 <span class="numeric_literal">100</span>
45 } 46 }
46} 47}
47 48
48<span class="comment">// comment</span> 49<span class="comment">// comment</span>
49<span class="keyword">fn</span> <span class="function">main</span>() { 50<span class="keyword">fn</span> <span class="function declaration">main</span>() {
50 <span class="macro">println</span><span class="macro">!</span>(<span class="string">"Hello, {}!"</span>, <span class="literal.numeric">92</span>); 51 <span class="macro">println</span><span class="macro">!</span>(<span class="string_literal">"Hello, {}!"</span>, <span class="numeric_literal">92</span>);
51 52
52 <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable.mut">vec</span> = Vec::new(); 53 <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable declaration mutable">vec</span> = Vec::new();
53 <span class="keyword.control">if</span> <span class="keyword">true</span> { 54 <span class="keyword control">if</span> <span class="keyword">true</span> {
54 <span class="keyword">let</span> <span class="variable">x</span> = <span class="literal.numeric">92</span>; 55 <span class="keyword">let</span> <span class="variable declaration">x</span> = <span class="numeric_literal">92</span>;
55 <span class="variable.mut">vec</span>.push(<span class="type">Foo</span> { <span class="field">x</span>, <span class="field">y</span>: <span class="literal.numeric">1</span> }); 56 <span class="variable mutable">vec</span>.push(<span class="struct">Foo</span> { <span class="field">x</span>, <span class="field">y</span>: <span class="numeric_literal">1</span> });
56 } 57 }
57 <span class="keyword.unsafe">unsafe</span> { <span class="variable.mut">vec</span>.set_len(<span class="literal.numeric">0</span>); } 58 <span class="keyword unsafe">unsafe</span> { <span class="variable mutable">vec</span>.set_len(<span class="numeric_literal">0</span>); }
58 59
59 <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable.mut">x</span> = <span class="literal.numeric">42</span>; 60 <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable declaration mutable">x</span> = <span class="numeric_literal">42</span>;
60 <span class="keyword">let</span> <span class="variable.mut">y</span> = &<span class="keyword">mut</span> <span class="variable.mut">x</span>; 61 <span class="keyword">let</span> <span class="variable declaration mutable">y</span> = &<span class="keyword">mut</span> <span class="variable mutable">x</span>;
61 <span class="keyword">let</span> <span class="variable">z</span> = &<span class="variable.mut">y</span>; 62 <span class="keyword">let</span> <span class="variable declaration">z</span> = &<span class="variable mutable">y</span>;
62 63
63 <span class="variable.mut">y</span>; 64 <span class="variable mutable">y</span>;
64} 65}
65 66
66<span class="keyword">enum</span> <span class="type">E</span>&lt;<span class="type.param">X</span>&gt; { 67<span class="keyword">enum</span> <span class="enum declaration">Option</span>&lt;<span class="type_param declaration">T</span>&gt; {
67 <span class="constant">V</span>(<span class="type.param">X</span>) 68 <span class="enum_variant declaration">Some</span>(<span class="type_param">T</span>),
69 <span class="enum_variant declaration">None</span>,
68} 70}
71<span class="keyword">use</span> <span class="enum">Option</span>::*;
69 72
70<span class="keyword">impl</span>&lt;<span class="type.param">X</span>&gt; <span class="type">E</span>&lt;<span class="type.param">X</span>&gt; { 73<span class="keyword">impl</span>&lt;<span class="type_param declaration">T</span>&gt; <span class="enum">Option</span>&lt;<span class="type_param">T</span>&gt; {
71 <span class="keyword">fn</span> <span class="function">new</span>&lt;<span class="type.param">T</span>&gt;() -&gt; <span class="type">E</span>&lt;<span class="type.param">T</span>&gt; {} 74 <span class="keyword">fn</span> <span class="function declaration">and</span>&lt;<span class="type_param declaration">U</span>&gt;(<span class="keyword">self</span>, <span class="variable declaration">other</span>: <span class="enum">Option</span>&lt;<span class="type_param">U</span>&gt;) -&gt; <span class="enum">Option</span>&lt;(<span class="type_param">T</span>, <span class="type_param">U</span>)&gt; {
75 <span class="keyword control">match</span> <span class="variable">other</span> {
76 <span class="enum_variant">None</span> =&gt; <span class="macro">unimplemented</span><span class="macro">!</span>(),
77 <span class="variable declaration">Nope</span> =&gt; <span class="variable">Nope</span>,
78 }
79 }
72}</code></pre> \ No newline at end of file 80}</code></pre> \ No newline at end of file