aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/test_data/highlight_doctest.html
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/test_data/highlight_doctest.html')
-rw-r--r--crates/ra_ide/test_data/highlight_doctest.html101
1 files changed, 101 insertions, 0 deletions
diff --git a/crates/ra_ide/test_data/highlight_doctest.html b/crates/ra_ide/test_data/highlight_doctest.html
new file mode 100644
index 000000000..e8155def7
--- /dev/null
+++ b/crates/ra_ide/test_data/highlight_doctest.html
@@ -0,0 +1,101 @@
1
2<style>
3body { margin: 0; }
4pre { 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="comment documentation">/// ```</span>
38<span class="comment documentation">/// </span><span class="keyword injected">let</span><span class="generic injected"> _ = </span><span class="string_literal injected">"early doctests should not go boom"</span><span class="generic injected">;</span>
39<span class="comment documentation">/// ```</span>
40<span class="keyword">struct</span> <span class="struct declaration">Foo</span> {
41 <span class="field declaration">bar</span>: <span class="builtin_type">bool</span>,
42}
43
44<span class="keyword">impl</span> <span class="struct">Foo</span> {
45 <span class="keyword">pub</span> <span class="keyword">const</span> <span class="constant declaration">bar</span>: <span class="builtin_type">bool</span> = <span class="bool_literal">true</span>;
46
47 <span class="comment documentation">/// Constructs a new `Foo`.</span>
48 <span class="comment documentation">///</span>
49 <span class="comment documentation">/// # Examples</span>
50 <span class="comment documentation">///</span>
51 <span class="comment documentation">/// ```</span>
52 <span class="comment documentation">/// #</span><span class="generic injected"> </span><span class="attribute injected">#![</span><span class="function attribute injected">allow</span><span class="attribute injected">(unused_mut)]</span>
53 <span class="comment documentation">/// </span><span class="keyword injected">let</span><span class="generic injected"> </span><span class="keyword injected">mut</span><span class="generic injected"> </span><span class="variable declaration injected mutable">foo</span><span class="generic injected">: </span><span class="struct injected">Foo</span><span class="generic injected"> = </span><span class="struct injected">Foo</span><span class="generic injected">::</span><span class="function injected">new</span><span class="generic injected">();</span>
54 <span class="comment documentation">/// ```</span>
55 <span class="keyword">pub</span> <span class="keyword">const</span> <span class="keyword">fn</span> <span class="function declaration">new</span>() -&gt; <span class="struct">Foo</span> {
56 <span class="struct">Foo</span> { <span class="field">bar</span>: <span class="bool_literal">true</span> }
57 }
58
59 <span class="comment documentation">/// `bar` method on `Foo`.</span>
60 <span class="comment documentation">///</span>
61 <span class="comment documentation">/// # Examples</span>
62 <span class="comment documentation">///</span>
63 <span class="comment documentation">/// ```</span>
64 <span class="comment documentation">/// </span><span class="keyword injected">use</span><span class="generic injected"> </span><span class="module injected">x</span><span class="generic injected">::</span><span class="module injected">y</span><span class="generic injected">;</span>
65 <span class="comment documentation">///</span>
66 <span class="comment documentation">/// </span><span class="keyword injected">let</span><span class="generic injected"> </span><span class="variable declaration injected">foo</span><span class="generic injected"> = </span><span class="struct injected">Foo</span><span class="generic injected">::</span><span class="function injected">new</span><span class="generic injected">();</span>
67 <span class="comment documentation">///</span>
68 <span class="comment documentation">/// </span><span class="comment injected">// calls bar on foo</span>
69 <span class="comment documentation">/// </span><span class="macro injected">assert!</span><span class="generic injected">(foo.bar());</span>
70 <span class="comment documentation">///</span>
71 <span class="comment documentation">/// </span><span class="keyword injected">let</span><span class="generic injected"> </span><span class="variable declaration injected">bar</span><span class="generic injected"> = </span><span class="variable injected">foo</span><span class="generic injected">.</span><span class="field injected">bar</span><span class="generic injected"> || </span><span class="struct injected">Foo</span><span class="generic injected">::</span><span class="constant injected">bar</span><span class="generic injected">;</span>
72 <span class="comment documentation">///</span>
73 <span class="comment documentation">/// </span><span class="comment injected">/* multi-line
74 </span><span class="comment documentation">/// </span><span class="comment injected"> comment */</span>
75 <span class="comment documentation">///</span>
76 <span class="comment documentation">/// </span><span class="keyword injected">let</span><span class="generic injected"> </span><span class="variable declaration injected">multi_line_string</span><span class="generic injected"> = </span><span class="string_literal injected">"Foo
77 </span><span class="comment documentation">/// </span><span class="string_literal injected"> bar
78 </span><span class="comment documentation">/// </span><span class="string_literal injected"> "</span><span class="generic injected">;</span>
79 <span class="comment documentation">///</span>
80 <span class="comment documentation">/// ```</span>
81 <span class="comment documentation">///</span>
82 <span class="comment documentation">/// ```rust,no_run</span>
83 <span class="comment documentation">/// </span><span class="keyword injected">let</span><span class="generic injected"> </span><span class="variable declaration injected">foobar</span><span class="generic injected"> = </span><span class="struct injected">Foo</span><span class="generic injected">::</span><span class="function injected">new</span><span class="generic injected">().</span><span class="function injected">bar</span><span class="generic injected">();</span>
84 <span class="comment documentation">/// ```</span>
85 <span class="comment documentation">///</span>
86 <span class="comment documentation">/// ```sh</span>
87 <span class="comment documentation">/// echo 1</span>
88 <span class="comment documentation">/// ```</span>
89 <span class="keyword">pub</span> <span class="keyword">fn</span> <span class="function declaration">foo</span>(&<span class="self_keyword">self</span>) -&gt; <span class="builtin_type">bool</span> {
90 <span class="bool_literal">true</span>
91 }
92}
93
94<span class="comment documentation">/// ```</span>
95<span class="comment documentation">/// </span><span class="macro injected">noop!</span><span class="generic injected">(</span><span class="numeric_literal injected">1</span><span class="generic injected">);</span>
96<span class="comment documentation">/// ```</span>
97<span class="macro">macro_rules!</span> <span class="macro declaration">noop</span> {
98 ($expr:expr) =&gt; {
99 $expr
100 }
101}</code></pre> \ No newline at end of file