diff options
Diffstat (limited to 'crates/ra_ide/src/snapshots/highlighting.html')
-rw-r--r-- | crates/ra_ide/src/snapshots/highlighting.html | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/crates/ra_ide/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html index 4b12fe823..42c5f3e55 100644 --- a/crates/ra_ide/src/snapshots/highlighting.html +++ b/crates/ra_ide/src/snapshots/highlighting.html | |||
@@ -10,6 +10,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
10 | .string_literal { color: #CC9393; } | 10 | .string_literal { color: #CC9393; } |
11 | .field { color: #94BFF3; } | 11 | .field { color: #94BFF3; } |
12 | .function { color: #93E0E3; } | 12 | .function { color: #93E0E3; } |
13 | .operator.unsafe { color: #E28C14; } | ||
13 | .parameter { color: #94BFF3; } | 14 | .parameter { color: #94BFF3; } |
14 | .text { color: #DCDCCC; } | 15 | .text { color: #DCDCCC; } |
15 | .type { color: #7CB8BB; } | 16 | .type { color: #7CB8BB; } |
@@ -17,6 +18,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
17 | .type_param { color: #DFAF8F; } | 18 | .type_param { color: #DFAF8F; } |
18 | .attribute { color: #94BFF3; } | 19 | .attribute { color: #94BFF3; } |
19 | .numeric_literal { color: #BFEBBF; } | 20 | .numeric_literal { color: #BFEBBF; } |
21 | .bool_literal { color: #BFE6EB; } | ||
20 | .macro { color: #94BFF3; } | 22 | .macro { color: #94BFF3; } |
21 | .module { color: #AFD8AF; } | 23 | .module { color: #AFD8AF; } |
22 | .variable { color: #DCDCCC; } | 24 | .variable { color: #DCDCCC; } |
@@ -27,17 +29,29 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
27 | .keyword.unsafe { color: #BC8383; font-weight: bold; } | 29 | .keyword.unsafe { color: #BC8383; font-weight: bold; } |
28 | .control { font-style: italic; } | 30 | .control { font-style: italic; } |
29 | </style> | 31 | </style> |
30 | <pre><code><span class="attribute">#[derive(Clone, Debug)]</span> | 32 | <pre><code><span class="attribute">#[</span><span class="function attribute">derive</span><span class="attribute">(Clone, Debug)]</span> |
31 | <span class="keyword">struct</span> <span class="struct declaration">Foo</span> { | 33 | <span class="keyword">struct</span> <span class="struct declaration">Foo</span> { |
32 | <span class="keyword">pub</span> <span class="field declaration">x</span>: <span class="builtin_type">i32</span>, | 34 | <span class="keyword">pub</span> <span class="field declaration">x</span>: <span class="builtin_type">i32</span>, |
33 | <span class="keyword">pub</span> <span class="field declaration">y</span>: <span class="builtin_type">i32</span>, | 35 | <span class="keyword">pub</span> <span class="field declaration">y</span>: <span class="builtin_type">i32</span>, |
34 | } | 36 | } |
35 | 37 | ||
38 | <span class="keyword">trait</span> <span class="trait declaration">Bar</span> { | ||
39 | <span class="keyword">fn</span> <span class="function declaration">bar</span>(&<span class="self_keyword">self</span>) -> <span class="builtin_type">i32</span>; | ||
40 | } | ||
41 | |||
42 | <span class="keyword">impl</span> <span class="trait">Bar</span> <span class="keyword">for</span> <span class="struct">Foo</span> { | ||
43 | <span class="keyword">fn</span> <span class="function declaration">bar</span>(&<span class="self_keyword">self</span>) -> <span class="builtin_type">i32</span> { | ||
44 | <span class="self_keyword">self</span>.<span class="field">x</span> | ||
45 | } | ||
46 | } | ||
47 | |||
48 | <span class="keyword">static</span> <span class="keyword">mut</span> <span class="static declaration mutable">STATIC_MUT</span>: <span class="builtin_type">i32</span> = <span class="numeric_literal">0</span>; | ||
49 | |||
36 | <span class="keyword">fn</span> <span class="function declaration">foo</span><<span class="lifetime declaration">'a</span>, <span class="type_param declaration">T</span>>() -> <span class="type_param">T</span> { | 50 | <span class="keyword">fn</span> <span class="function declaration">foo</span><<span class="lifetime declaration">'a</span>, <span class="type_param declaration">T</span>>() -> <span class="type_param">T</span> { |
37 | <span class="function">foo</span>::<<span class="lifetime">'a</span>, <span class="builtin_type">i32</span>>() | 51 | <span class="function">foo</span>::<<span class="lifetime">'a</span>, <span class="builtin_type">i32</span>>() |
38 | } | 52 | } |
39 | 53 | ||
40 | <span class="macro">macro_rules!</span> def_fn { | 54 | <span class="macro">macro_rules!</span> <span class="macro declaration">def_fn</span> { |
41 | ($($tt:tt)*) => {$($tt)*} | 55 | ($($tt:tt)*) => {$($tt)*} |
42 | } | 56 | } |
43 | 57 | ||
@@ -52,11 +66,18 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
52 | <span class="macro">println!</span>(<span class="string_literal">"Hello, {}!"</span>, <span class="numeric_literal">92</span>); | 66 | <span class="macro">println!</span>(<span class="string_literal">"Hello, {}!"</span>, <span class="numeric_literal">92</span>); |
53 | 67 | ||
54 | <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable declaration mutable">vec</span> = <span class="unresolved_reference">Vec</span>::<span class="unresolved_reference">new</span>(); | 68 | <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable declaration mutable">vec</span> = <span class="unresolved_reference">Vec</span>::<span class="unresolved_reference">new</span>(); |
55 | <span class="keyword control">if</span> <span class="keyword">true</span> { | 69 | <span class="keyword control">if</span> <span class="bool_literal">true</span> { |
56 | <span class="keyword">let</span> <span class="variable declaration">x</span> = <span class="numeric_literal">92</span>; | 70 | <span class="keyword">let</span> <span class="variable declaration">x</span> = <span class="numeric_literal">92</span>; |
57 | <span class="variable mutable">vec</span>.<span class="unresolved_reference">push</span>(<span class="struct">Foo</span> { <span class="field">x</span>, <span class="field">y</span>: <span class="numeric_literal">1</span> }); | 71 | <span class="variable mutable">vec</span>.<span class="unresolved_reference">push</span>(<span class="struct">Foo</span> { <span class="field">x</span>, <span class="field">y</span>: <span class="numeric_literal">1</span> }); |
58 | } | 72 | } |
59 | <span class="keyword unsafe">unsafe</span> { <span class="variable mutable">vec</span>.<span class="unresolved_reference">set_len</span>(<span class="numeric_literal">0</span>); } | 73 | <span class="keyword unsafe">unsafe</span> { |
74 | <span class="variable mutable">vec</span>.<span class="unresolved_reference">set_len</span>(<span class="numeric_literal">0</span>); | ||
75 | <span class="static mutable">STATIC_MUT</span> = <span class="numeric_literal">1</span>; | ||
76 | } | ||
77 | |||
78 | <span class="keyword control">for</span> <span class="variable declaration">e</span> <span class="keyword control">in</span> <span class="variable mutable">vec</span> { | ||
79 | <span class="comment">// Do nothing</span> | ||
80 | } | ||
60 | 81 | ||
61 | <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable declaration mutable">x</span> = <span class="numeric_literal">42</span>; | 82 | <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable declaration mutable">x</span> = <span class="numeric_literal">42</span>; |
62 | <span class="keyword">let</span> <span class="variable declaration mutable">y</span> = &<span class="keyword">mut</span> <span class="variable mutable">x</span>; | 83 | <span class="keyword">let</span> <span class="variable declaration mutable">y</span> = &<span class="keyword">mut</span> <span class="variable mutable">x</span>; |
@@ -72,7 +93,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
72 | <span class="keyword">use</span> <span class="enum">Option</span>::*; | 93 | <span class="keyword">use</span> <span class="enum">Option</span>::*; |
73 | 94 | ||
74 | <span class="keyword">impl</span><<span class="type_param declaration">T</span>> <span class="enum">Option</span><<span class="type_param">T</span>> { | 95 | <span class="keyword">impl</span><<span class="type_param declaration">T</span>> <span class="enum">Option</span><<span class="type_param">T</span>> { |
75 | <span class="keyword">fn</span> <span class="function declaration">and</span><<span class="type_param declaration">U</span>>(<span class="keyword">self</span>, <span class="variable declaration">other</span>: <span class="enum">Option</span><<span class="type_param">U</span>>) -> <span class="enum">Option</span><(<span class="type_param">T</span>, <span class="type_param">U</span>)> { | 96 | <span class="keyword">fn</span> <span class="function declaration">and</span><<span class="type_param declaration">U</span>>(<span class="self_keyword">self</span>, <span class="variable declaration">other</span>: <span class="enum">Option</span><<span class="type_param">U</span>>) -> <span class="enum">Option</span><(<span class="type_param">T</span>, <span class="type_param">U</span>)> { |
76 | <span class="keyword control">match</span> <span class="variable">other</span> { | 97 | <span class="keyword control">match</span> <span class="variable">other</span> { |
77 | <span class="enum_variant">None</span> => <span class="macro">unimplemented!</span>(), | 98 | <span class="enum_variant">None</span> => <span class="macro">unimplemented!</span>(), |
78 | <span class="variable declaration">Nope</span> => <span class="variable">Nope</span>, | 99 | <span class="variable declaration">Nope</span> => <span class="variable">Nope</span>, |