diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-28 15:56:07 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-28 15:56:07 +0000 |
commit | c692e07b4ff648fea742c53c0dbad57d6f652068 (patch) | |
tree | d186df8fb298272eaa4ce14d2fccc854413bc566 /crates/ra_ide/src/snapshots/highlighting.html | |
parent | 93f632ca4e7bb7fd54830e456d629a4948a92337 (diff) | |
parent | 56ce34c6a7ec0b4426d4cb25e10512c7efaf6f06 (diff) |
Merge #3367
3367: Fix highlighting of const patterns r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/snapshots/highlighting.html')
-rw-r--r-- | crates/ra_ide/src/snapshots/highlighting.html | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/crates/ra_ide/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html index 8c372ad27..495b07f69 100644 --- a/crates/ra_ide/src/snapshots/highlighting.html +++ b/crates/ra_ide/src/snapshots/highlighting.html | |||
@@ -3,7 +3,7 @@ | |||
3 | body { margin: 0; } | 3 | body { margin: 0; } |
4 | pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padding: 0.4em; } | 4 | pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padding: 0.4em; } |
5 | 5 | ||
6 | 6 | .lifetime { color: #DFAF8F; font-style: italic; } | |
7 | .comment { color: #7F9F7F; } | 7 | .comment { color: #7F9F7F; } |
8 | .struct, .enum { color: #7CB8BB; } | 8 | .struct, .enum { color: #7CB8BB; } |
9 | .enum_variant { color: #BDE0F3; } | 9 | .enum_variant { color: #BDE0F3; } |
@@ -27,14 +27,13 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
27 | .control { font-style: italic; } | 27 | .control { font-style: italic; } |
28 | </style> | 28 | </style> |
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> | 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> |
30 | <span class="keyword">struct</span> <span class="struct">Foo</span> { | 30 | <span class="keyword">struct</span> <span class="struct declaration">Foo</span> { |
31 | <span class="keyword">pub</span> <span class="field">x</span>: <span class="builtin_type">i32</span>, | 31 | <span class="keyword">pub</span> <span class="field declaration">x</span>: <span class="builtin_type">i32</span>, |
32 | <span class="keyword">pub</span> <span class="field">y</span>: <span class="builtin_type">i32</span>, | 32 | <span class="keyword">pub</span> <span class="field declaration">y</span>: <span class="builtin_type">i32</span>, |
33 | } | 33 | } |
34 | 34 | ||
35 | <span class="keyword">fn</span> <span class="function">foo</span><<span class="type_param">T</span>>() -> <span class="type_param">T</span> { | 35 | <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> { |
36 | <span class="macro">unimplemented</span><span class="macro">!</span>(); | 36 | <span class="function">foo</span>::<<span class="lifetime">'a</span>, <span class="builtin_type">i32</span>>() |
37 | <span class="function">foo</span>::<<span class="builtin_type">i32</span>>(); | ||
38 | } | 37 | } |
39 | 38 | ||
40 | <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 { |
@@ -42,33 +41,40 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
42 | } | 41 | } |
43 | 42 | ||
44 | <span class="macro">def_fn</span><span class="macro">!</span> { | 43 | <span class="macro">def_fn</span><span class="macro">!</span> { |
45 | <span class="keyword">fn</span> <span class="function">bar</span>() -> <span class="builtin_type">u32</span> { | 44 | <span class="keyword">fn</span> <span class="function declaration">bar</span>() -> <span class="builtin_type">u32</span> { |
46 | <span class="numeric_literal">100</span> | 45 | <span class="numeric_literal">100</span> |
47 | } | 46 | } |
48 | } | 47 | } |
49 | 48 | ||
50 | <span class="comment">// comment</span> | 49 | <span class="comment">// comment</span> |
51 | <span class="keyword">fn</span> <span class="function">main</span>() { | 50 | <span class="keyword">fn</span> <span class="function declaration">main</span>() { |
52 | <span class="macro">println</span><span class="macro">!</span>(<span class="string_literal">"Hello, {}!"</span>, <span class="numeric_literal">92</span>); | 51 | <span class="macro">println</span><span class="macro">!</span>(<span class="string_literal">"Hello, {}!"</span>, <span class="numeric_literal">92</span>); |
53 | 52 | ||
54 | <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable mutable">vec</span> = Vec::new(); | 53 | <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable declaration mutable">vec</span> = Vec::new(); |
55 | <span class="keyword control">if</span> <span class="keyword">true</span> { | 54 | <span class="keyword control">if</span> <span class="keyword">true</span> { |
56 | <span class="keyword">let</span> <span class="variable">x</span> = <span class="numeric_literal">92</span>; | 55 | <span class="keyword">let</span> <span class="variable declaration">x</span> = <span class="numeric_literal">92</span>; |
57 | <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 | <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> }); |
58 | } | 57 | } |
59 | <span class="keyword unsafe">unsafe</span> { <span class="variable mutable">vec</span>.set_len(<span class="numeric_literal">0</span>); } | 58 | <span class="keyword unsafe">unsafe</span> { <span class="variable mutable">vec</span>.set_len(<span class="numeric_literal">0</span>); } |
60 | 59 | ||
61 | <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable mutable">x</span> = <span class="numeric_literal">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>; |
62 | <span class="keyword">let</span> <span class="variable mutable">y</span> = &<span class="keyword">mut</span> <span class="variable mutable">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>; |
63 | <span class="keyword">let</span> <span class="variable">z</span> = &<span class="variable mutable">y</span>; | 62 | <span class="keyword">let</span> <span class="variable declaration">z</span> = &<span class="variable mutable">y</span>; |
64 | 63 | ||
65 | <span class="variable mutable">y</span>; | 64 | <span class="variable mutable">y</span>; |
66 | } | 65 | } |
67 | 66 | ||
68 | <span class="keyword">enum</span> <span class="enum">E</span><<span class="type_param">X</span>> { | 67 | <span class="keyword">enum</span> <span class="enum declaration">Option</span><<span class="type_param declaration">T</span>> { |
69 | <span class="enum_variant">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>, | ||
70 | } | 70 | } |
71 | <span class="keyword">use</span> <span class="enum">Option</span>::*; | ||
71 | 72 | ||
72 | <span class="keyword">impl</span><<span class="type_param">X</span>> <span class="enum">E</span><<span class="type_param">X</span>> { | 73 | <span class="keyword">impl</span><<span class="type_param declaration">T</span>> <span class="enum">Option</span><<span class="type_param">T</span>> { |
73 | <span class="keyword">fn</span> <span class="function">new</span><<span class="type_param">T</span>>() -> <span class="enum">E</span><<span class="type_param">T</span>> {} | 74 | <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>)> { |
75 | <span class="keyword control">match</span> <span class="variable">other</span> { | ||
76 | <span class="enum_variant">None</span> => <span class="macro">unimplemented</span><span class="macro">!</span>(), | ||
77 | <span class="variable declaration">Nope</span> => <span class="variable">Nope</span>, | ||
78 | } | ||
79 | } | ||
74 | }</code></pre> \ No newline at end of file | 80 | }</code></pre> \ No newline at end of file |