diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-27 10:56:06 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-27 10:56:06 +0100 |
commit | 0d1c6076073c73f57340e256dc25da9d37311ef0 (patch) | |
tree | 60ff1f4a42f8ef297c07d5716af67e3057c8e1bd /crates/ra_ide_api/src/snapshots/highlighting.html | |
parent | 4b48cff022a1606bde596f01fbf44361640b10d8 (diff) | |
parent | 1e6ba1901550fb1610a1a464c48ec358cd3c339c (diff) |
Merge #1319
1319: Rainbow highlighting spike 🌈 r=killercup a=killercup
Very simple approach: For each identifier, set the hash of the range
where it's defined as its 'id' and use it in the VSCode extension to
generate unique colors.
Thus, the generated colors are per-file. They are also quite fragile,
and I'm not entirely sure why. Looks like we need to make sure the
same ranges aren't overwritten by a later request?
Co-authored-by: Pascal Hertleif <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/snapshots/highlighting.html')
-rw-r--r-- | crates/ra_ide_api/src/snapshots/highlighting.html | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/crates/ra_ide_api/src/snapshots/highlighting.html b/crates/ra_ide_api/src/snapshots/highlighting.html index bfc0a67b1..ebd187a35 100644 --- a/crates/ra_ide_api/src/snapshots/highlighting.html +++ b/crates/ra_ide_api/src/snapshots/highlighting.html | |||
@@ -1,10 +1,7 @@ | |||
1 | 1 | ||
2 | <style> | 2 | <style> |
3 | pre { | 3 | body { margin: 0; } |
4 | color: #DCDCCC; | 4 | pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padding: 0.4em; } |
5 | background-color: #3F3F3F; | ||
6 | font-size: 22px; | ||
7 | } | ||
8 | 5 | ||
9 | .comment { color: #7F9F7F; } | 6 | .comment { color: #7F9F7F; } |
10 | .string { color: #CC9393; } | 7 | .string { color: #CC9393; } |
@@ -19,10 +16,8 @@ pre { | |||
19 | .keyword { color: #F0DFAF; } | 16 | .keyword { color: #F0DFAF; } |
20 | .keyword\.unsafe { color: #F0DFAF; font-weight: bold; } | 17 | .keyword\.unsafe { color: #F0DFAF; font-weight: bold; } |
21 | .keyword\.control { color: #DC8CC3; } | 18 | .keyword\.control { color: #DC8CC3; } |
22 | |||
23 | </style> | 19 | </style> |
24 | <pre><code> | 20 | <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> |
25 | <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> | ||
26 | <span class="keyword">struct</span> <span class="function">Foo</span> { | 21 | <span class="keyword">struct</span> <span class="function">Foo</span> { |
27 | <span class="keyword">pub</span> <span class="function">x</span>: <span class="text">i32</span>, | 22 | <span class="keyword">pub</span> <span class="function">x</span>: <span class="text">i32</span>, |
28 | <span class="keyword">pub</span> <span class="function">y</span>: <span class="text">i32</span>, | 23 | <span class="keyword">pub</span> <span class="function">y</span>: <span class="text">i32</span>, |
@@ -36,10 +31,9 @@ pre { | |||
36 | <span class="keyword">fn</span> <span class="function">main</span>() { | 31 | <span class="keyword">fn</span> <span class="function">main</span>() { |
37 | <span class="macro">println</span><span class="macro">!</span>(<span class="string">"Hello, {}!"</span>, <span class="literal">92</span>); | 32 | <span class="macro">println</span><span class="macro">!</span>(<span class="string">"Hello, {}!"</span>, <span class="literal">92</span>); |
38 | 33 | ||
39 | <span class="keyword">let</span> <span class="keyword">mut</span> <span class="function">vec</span> = <span class="text">Vec</span>::<span class="text">new</span>(); | 34 | <span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable" data-binding-hash="9636295041291189729" style="color: hsl(51,57%,74%);">vec</span> = <span class="text">Vec</span>::<span class="text">new</span>(); |
40 | <span class="keyword.control">if</span> <span class="keyword">true</span> { | 35 | <span class="keyword.control">if</span> <span class="keyword">true</span> { |
41 | <span class="text">vec</span>.<span class="text">push</span>(<span class="type">Foo</span> { <span class="field">x</span>: <span class="literal">0</span>, <span class="field">y</span>: <span class="literal">1</span> }); | 36 | <span class="variable" data-binding-hash="8496027264380925433" style="color: hsl(18,48%,55%);">vec</span>.<span class="text">push</span>(<span class="type">Foo</span> { <span class="field">x</span>: <span class="literal">0</span>, <span class="field">y</span>: <span class="literal">1</span> }); |
42 | } | 37 | } |
43 | <span class="keyword.unsafe">unsafe</span> { <span class="text">vec</span>.<span class="text">set_len</span>(<span class="literal">0</span>); } | 38 | <span class="keyword.unsafe">unsafe</span> { <span class="variable" data-binding-hash="8496027264380925433" style="color: hsl(18,48%,55%);">vec</span>.<span class="text">set_len</span>(<span class="literal">0</span>); } |
44 | } | 39 | }</code></pre> \ No newline at end of file |
45 | </code></pre> \ No newline at end of file | ||