diff options
Diffstat (limited to 'crates/ra_ide/test_data/highlighting.html')
-rw-r--r-- | crates/ra_ide/test_data/highlighting.html | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/crates/ra_ide/test_data/highlighting.html b/crates/ra_ide/test_data/highlighting.html new file mode 100644 index 000000000..8d0b38f95 --- /dev/null +++ b/crates/ra_ide/test_data/highlighting.html | |||
@@ -0,0 +1,117 @@ | |||
1 | |||
2 | <style> | ||
3 | body { margin: 0; } | ||
4 | pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padding: 0.4em; } | ||
5 | |||
6 | .lifetime { color: #DFAF8F; font-style: italic; } | ||
7 | .comment { color: #7F9F7F; } | ||
8 | .documentation { color: #629755; } | ||
9 | .injected { opacity: 0.65 ; } | ||
10 | .struct, .enum { color: #7CB8BB; } | ||
11 | .enum_variant { color: #BDE0F3; } | ||
12 | .string_literal { color: #CC9393; } | ||
13 | .field { color: #94BFF3; } | ||
14 | .function { color: #93E0E3; } | ||
15 | .function.unsafe { color: #BC8383; } | ||
16 | .operator.unsafe { color: #BC8383; } | ||
17 | .parameter { color: #94BFF3; } | ||
18 | .text { color: #DCDCCC; } | ||
19 | .type { color: #7CB8BB; } | ||
20 | .builtin_type { color: #8CD0D3; } | ||
21 | .type_param { color: #DFAF8F; } | ||
22 | .attribute { color: #94BFF3; } | ||
23 | .numeric_literal { color: #BFEBBF; } | ||
24 | .bool_literal { color: #BFE6EB; } | ||
25 | .macro { color: #94BFF3; } | ||
26 | .module { color: #AFD8AF; } | ||
27 | .variable { color: #DCDCCC; } | ||
28 | .format_specifier { color: #CC696B; } | ||
29 | .mutable { text-decoration: underline; } | ||
30 | .unresolved_reference { color: #FC5555; } | ||
31 | .escape_sequence { color: #94BFF3; } | ||
32 | |||
33 | .keyword { color: #F0DFAF; font-weight: bold; } | ||
34 | .keyword.unsafe { color: #BC8383; font-weight: bold; } | ||
35 | .control { font-style: italic; } | ||
36 | </style> | ||
37 | <pre><code><span class="attribute">#[</span><span class="function attribute">derive</span><span class="attribute">(Clone, Debug)]</span> | ||
38 | <span class="keyword">struct</span> <span class="struct declaration">Foo</span> { | ||
39 | <span class="keyword">pub</span> <span class="field declaration">x</span>: <span class="builtin_type">i32</span>, | ||
40 | <span class="keyword">pub</span> <span class="field declaration">y</span>: <span class="builtin_type">i32</span>, | ||
41 | } | ||
42 | |||
43 | <span class="keyword">trait</span> <span class="trait declaration">Bar</span> { | ||
44 | <span class="keyword">fn</span> <span class="function declaration">bar</span>(&<span class="self_keyword">self</span>) -> <span class="builtin_type">i32</span>; | ||
45 | } | ||
46 | |||
47 | <span class="keyword">impl</span> <span class="trait">Bar</span> <span class="keyword">for</span> <span class="struct">Foo</span> { | ||
48 | <span class="keyword">fn</span> <span class="function declaration">bar</span>(&<span class="self_keyword">self</span>) -> <span class="builtin_type">i32</span> { | ||
49 | <span class="self_keyword">self</span>.<span class="field">x</span> | ||
50 | } | ||
51 | } | ||
52 | |||
53 | <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>; | ||
54 | |||
55 | <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> { | ||
56 | <span class="function">foo</span>::<<span class="lifetime">'a</span>, <span class="builtin_type">i32</span>>() | ||
57 | } | ||
58 | |||
59 | <span class="macro">macro_rules!</span> <span class="macro declaration">def_fn</span> { | ||
60 | ($($tt:tt)*) => {$($tt)*} | ||
61 | } | ||
62 | |||
63 | <span class="macro">def_fn!</span> { | ||
64 | <span class="keyword">fn</span> <span class="function declaration">bar</span>() -> <span class="builtin_type">u32</span> { | ||
65 | <span class="numeric_literal">100</span> | ||
66 | } | ||
67 | } | ||
68 | |||
69 | <span class="macro">macro_rules!</span> <span class="macro declaration">noop</span> { | ||
70 | ($expr:expr) => { | ||
71 | $expr | ||
72 | } | ||
73 | } | ||
74 | |||
75 | <span class="comment">// comment</span> | ||
76 | <span class="keyword">fn</span> <span class="function declaration">main</span>() { | ||
77 | <span class="macro">println!</span>(<span class="string_literal">"Hello, {}!"</span>, <span class="numeric_literal">92</span>); | ||
78 | |||
79 | <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>(); | ||
80 | <span class="keyword control">if</span> <span class="bool_literal">true</span> { | ||
81 | <span class="keyword">let</span> <span class="variable declaration">x</span> = <span class="numeric_literal">92</span>; | ||
82 | <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> }); | ||
83 | } | ||
84 | <span class="keyword unsafe">unsafe</span> { | ||
85 | <span class="variable mutable">vec</span>.<span class="unresolved_reference">set_len</span>(<span class="numeric_literal">0</span>); | ||
86 | <span class="static mutable">STATIC_MUT</span> = <span class="numeric_literal">1</span>; | ||
87 | } | ||
88 | |||
89 | <span class="keyword control">for</span> <span class="variable declaration">e</span> <span class="keyword control">in</span> <span class="variable mutable">vec</span> { | ||
90 | <span class="comment">// Do nothing</span> | ||
91 | } | ||
92 | |||
93 | <span class="macro">noop!</span>(<span class="macro">noop</span><span class="macro">!</span>(<span class="numeric_literal">1</span>)); | ||
94 | |||
95 | <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable declaration mutable">x</span> = <span class="numeric_literal">42</span>; | ||
96 | <span class="keyword">let</span> <span class="variable declaration mutable">y</span> = &<span class="keyword">mut</span> <span class="variable mutable">x</span>; | ||
97 | <span class="keyword">let</span> <span class="variable declaration">z</span> = &<span class="variable mutable">y</span>; | ||
98 | |||
99 | <span class="keyword">let</span> <span class="struct">Foo</span> { <span class="field">x</span>: <span class="variable declaration">z</span>, <span class="field">y</span> } = <span class="struct">Foo</span> { <span class="field">x</span>: <span class="variable">z</span>, <span class="field">y</span> }; | ||
100 | |||
101 | <span class="variable">y</span>; | ||
102 | } | ||
103 | |||
104 | <span class="keyword">enum</span> <span class="enum declaration">Option</span><<span class="type_param declaration">T</span>> { | ||
105 | <span class="enum_variant declaration">Some</span>(<span class="type_param">T</span>), | ||
106 | <span class="enum_variant declaration">None</span>, | ||
107 | } | ||
108 | <span class="keyword">use</span> <span class="enum">Option</span>::*; | ||
109 | |||
110 | <span class="keyword">impl</span><<span class="type_param declaration">T</span>> <span class="enum">Option</span><<span class="type_param">T</span>> { | ||
111 | <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>)> { | ||
112 | <span class="keyword control">match</span> <span class="variable">other</span> { | ||
113 | <span class="enum_variant">None</span> => <span class="macro">unimplemented!</span>(), | ||
114 | <span class="variable declaration">Nope</span> => <span class="variable">Nope</span>, | ||
115 | } | ||
116 | } | ||
117 | }</code></pre> \ No newline at end of file | ||