aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/snapshots
diff options
context:
space:
mode:
authorLeander Tentrup <[email protected]>2020-04-28 10:01:51 +0100
committerLeander Tentrup <[email protected]>2020-06-08 13:18:16 +0100
commit4a2efb2f42494f62891ac801e0a27d246bd36684 (patch)
tree42beb8f761b80edaf57fdb9c0a76a2818f7bb862 /crates/ra_ide/src/snapshots
parentd8552d114c3b2cedbc485ebe26d7b784c0845bd8 (diff)
Implement syntax highlighting for doctests
Diffstat (limited to 'crates/ra_ide/src/snapshots')
-rw-r--r--crates/ra_ide/src/snapshots/highlight_doctest.html70
1 files changed, 70 insertions, 0 deletions
diff --git a/crates/ra_ide/src/snapshots/highlight_doctest.html b/crates/ra_ide/src/snapshots/highlight_doctest.html
new file mode 100644
index 000000000..2f2d8c900
--- /dev/null
+++ b/crates/ra_ide/src/snapshots/highlight_doctest.html
@@ -0,0 +1,70 @@
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.struct, .enum { color: #7CB8BB; }
9.enum_variant { color: #BDE0F3; }
10.string_literal { color: #CC9393; }
11.field { color: #94BFF3; }
12.function { color: #93E0E3; }
13.operator.unsafe { color: #E28C14; }
14.parameter { color: #94BFF3; }
15.text { color: #DCDCCC; }
16.type { color: #7CB8BB; }
17.builtin_type { color: #8CD0D3; }
18.type_param { color: #DFAF8F; }
19.attribute { color: #94BFF3; }
20.numeric_literal { color: #BFEBBF; }
21.bool_literal { color: #BFE6EB; }
22.macro { color: #94BFF3; }
23.module { color: #AFD8AF; }
24.variable { color: #DCDCCC; }
25.format_specifier { color: #CC696B; }
26.mutable { text-decoration: underline; }
27
28.keyword { color: #F0DFAF; font-weight: bold; }
29.keyword.unsafe { color: #BC8383; font-weight: bold; }
30.control { font-style: italic; }
31</style>
32<pre><code><span class="keyword">impl</span> <span class="unresolved_reference">Foo</span> {
33 <span class="comment">/// Constructs a new `Foo`.</span>
34 <span class="comment">///</span>
35 <span class="comment">/// # Examples</span>
36 <span class="comment">///</span>
37 <span class="comment">/// ```</span>
38 <span class="comment">/// #</span> <span class="attribute">#![</span><span class="function attribute">allow</span><span class="attribute">(unused_mut)]</span>
39 <span class="comment">/// </span><span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable declaration mutable">foo</span>: <span class="unresolved_reference">Foo</span> = <span class="unresolved_reference">Foo</span>::<span class="unresolved_reference">new</span>();
40 <span class="comment">/// ```</span>
41 <span class="keyword">pub</span> <span class="keyword">const</span> <span class="keyword">fn</span> <span class="function declaration">new</span>() -&gt; <span class="unresolved_reference">Foo</span> {
42 <span class="unresolved_reference">Foo</span> { }
43 }
44
45 <span class="comment">/// `bar` method on `Foo`.</span>
46 <span class="comment">///</span>
47 <span class="comment">/// # Examples</span>
48 <span class="comment">///</span>
49 <span class="comment">/// ```</span>
50 <span class="comment">/// </span><span class="keyword">let</span> <span class="variable declaration">foo</span> = <span class="unresolved_reference">Foo</span>::<span class="unresolved_reference">new</span>();
51 <span class="comment">///</span>
52 <span class="comment">/// </span><span class="comment">// calls bar on foo</span>
53 <span class="comment">/// </span><span class="macro">assert!</span>(foo.bar());
54 <span class="comment">///</span>
55 <span class="comment">/// </span><span class="comment">/* multi-line
56 </span><span class="comment">/// </span><span class="comment"> comment */</span>
57 <span class="comment">///</span>
58 <span class="comment">/// </span><span class="keyword">let</span> <span class="variable declaration">multi_line_string</span> = <span class="string_literal">"Foo
59 </span><span class="comment">/// </span><span class="string_literal"> bar
60 </span><span class="comment">/// </span><span class="string_literal"> "</span>;
61 <span class="comment">///</span>
62 <span class="comment">/// ```</span>
63 <span class="comment">///</span>
64 <span class="comment">/// ```</span>
65 <span class="comment">/// </span><span class="keyword">let</span> <span class="variable declaration">foobar</span> = <span class="unresolved_reference">Foo</span>::<span class="unresolved_reference">new</span>().<span class="unresolved_reference">bar</span>();
66 <span class="comment">/// ```</span>
67 <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> {
68 <span class="bool_literal">true</span>
69 }
70}</code></pre> \ No newline at end of file