Skip to content

Commit 719babd

Browse files
bors[bot]Veykril
andauthored
Merge #11564
11564: internal: Cleanup highlighting tests r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
2 parents ddb5a53 + 36603e0 commit 719babd

9 files changed

+441
-407
lines changed

crates/ide/src/syntax_highlighting/test_data/highlight_assoc_functions.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,4 @@
5858
<span class="keyword">impl</span> <span class="trait">t</span> <span class="keyword">for</span> <span class="struct">foo</span> <span class="brace">{</span>
5959
<span class="keyword">pub</span> <span class="keyword">fn</span> <span class="function associated declaration public static trait">is_static</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="brace">{</span><span class="brace">}</span>
6060
<span class="keyword">pub</span> <span class="keyword">fn</span> <span class="function associated declaration public reference trait">is_not_static</span><span class="parenthesis">(</span><span class="operator">&</span><span class="self_keyword declaration reference">self</span><span class="parenthesis">)</span> <span class="brace">{</span><span class="brace">}</span>
61-
<span class="brace">}</span>
62-
</code></pre>
61+
<span class="brace">}</span></code></pre>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
.label { color: #DFAF8F; font-style: italic; }
8+
.comment { color: #7F9F7F; }
9+
.documentation { color: #629755; }
10+
.intra_doc_link { font-style: italic; }
11+
.injected { opacity: 0.65 ; }
12+
.struct, .enum { color: #7CB8BB; }
13+
.enum_variant { color: #BDE0F3; }
14+
.string_literal { color: #CC9393; }
15+
.field { color: #94BFF3; }
16+
.function { color: #93E0E3; }
17+
.function.unsafe { color: #BC8383; }
18+
.trait.unsafe { color: #BC8383; }
19+
.operator.unsafe { color: #BC8383; }
20+
.mutable.unsafe { color: #BC8383; text-decoration: underline; }
21+
.keyword.unsafe { color: #BC8383; font-weight: bold; }
22+
.parameter { color: #94BFF3; }
23+
.text { color: #DCDCCC; }
24+
.type { color: #7CB8BB; }
25+
.builtin_type { color: #8CD0D3; }
26+
.type_param { color: #DFAF8F; }
27+
.attribute { color: #94BFF3; }
28+
.numeric_literal { color: #BFEBBF; }
29+
.bool_literal { color: #BFE6EB; }
30+
.macro { color: #94BFF3; }
31+
.derive { color: #94BFF3; font-style: italic; }
32+
.module { color: #AFD8AF; }
33+
.value_param { color: #DCDCCC; }
34+
.variable { color: #DCDCCC; }
35+
.format_specifier { color: #CC696B; }
36+
.mutable { text-decoration: underline; }
37+
.escape_sequence { color: #94BFF3; }
38+
.keyword { color: #F0DFAF; font-weight: bold; }
39+
.control { font-style: italic; }
40+
.reference { font-style: italic; font-weight: bold; }
41+
42+
.unresolved_reference { color: #FC5555; text-decoration: wavy underline; }
43+
</style>
44+
<pre><code><span class="attribute_bracket attribute">#</span><span class="attribute_bracket attribute">[</span><span class="builtin_attr attribute library">allow</span><span class="parenthesis attribute">(</span><span class="none attribute">dead_code</span><span class="parenthesis attribute">)</span><span class="attribute_bracket attribute">]</span>
45+
<span class="attribute_bracket attribute">#</span><span class="attribute_bracket attribute">[</span><span class="tool_module attribute library">rustfmt</span><span class="operator attribute">::</span><span class="tool_module attribute library">skip</span><span class="attribute_bracket attribute">]</span>
46+
<span class="attribute_bracket attribute">#</span><span class="attribute_bracket attribute">[</span><span class="module attribute crate_root library">proc_macros</span><span class="operator attribute">::</span><span class="attribute attribute library">identity</span><span class="attribute_bracket attribute">]</span>
47+
<span class="attribute_bracket attribute">#</span><span class="attribute_bracket attribute">[</span><span class="attribute attribute default_library library">derive</span><span class="parenthesis attribute">(</span><span class="derive attribute default_library library">Copy</span><span class="parenthesis attribute">)</span><span class="attribute_bracket attribute">]</span>
48+
<span class="comment documentation">/// This is a doc comment</span>
49+
<span class="comment">// This is a normal comment</span>
50+
<span class="comment documentation">/// This is a doc comment</span>
51+
<span class="attribute_bracket attribute">#</span><span class="attribute_bracket attribute">[</span><span class="attribute attribute default_library library">derive</span><span class="parenthesis attribute">(</span><span class="derive attribute default_library library">Copy</span><span class="parenthesis attribute">)</span><span class="attribute_bracket attribute">]</span>
52+
<span class="comment">// This is another normal comment</span>
53+
<span class="comment documentation">/// This is another doc comment</span>
54+
<span class="comment">// This is another normal comment</span>
55+
<span class="attribute_bracket attribute">#</span><span class="attribute_bracket attribute">[</span><span class="attribute attribute default_library library">derive</span><span class="parenthesis attribute">(</span><span class="derive attribute default_library library">Copy</span><span class="parenthesis attribute">)</span><span class="attribute_bracket attribute">]</span>
56+
<span class="comment">// The reason for these being here is to test AttrIds</span>
57+
<span class="keyword">struct</span> <span class="struct declaration">Foo</span><span class="semicolon">;</span></code></pre>

crates/ide/src/syntax_highlighting/test_data/highlight_default_library.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,4 @@
4646
<span class="keyword">fn</span> <span class="function declaration">main</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="brace">{</span>
4747
<span class="keyword">let</span> <span class="variable declaration">foo</span> <span class="operator">=</span> <span class="enum_variant default_library library">Some</span><span class="parenthesis">(</span><span class="numeric_literal">92</span><span class="parenthesis">)</span><span class="semicolon">;</span>
4848
<span class="keyword">let</span> <span class="variable declaration">nums</span> <span class="operator">=</span> <span class="module default_library library">iter</span><span class="operator">::</span><span class="function default_library library">repeat</span><span class="parenthesis">(</span><span class="variable">foo</span><span class="operator">.</span><span class="function associated consuming default_library library">unwrap</span><span class="parenthesis">(</span><span class="parenthesis">)</span><span class="parenthesis">)</span><span class="semicolon">;</span>
49-
<span class="brace">}</span>
50-
</code></pre>
49+
<span class="brace">}</span></code></pre>

0 commit comments

Comments
 (0)