mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-24 05:33:41 +00:00
Better highlight for fixtures
This commit is contained in:
parent
62b17bac92
commit
4a8d2c098d
@ -42,6 +42,10 @@ pub(super) fn highlight_injection(
|
|||||||
offset += TextSize::of(chunk);
|
offset += TextSize::of(chunk);
|
||||||
|
|
||||||
if let Some(next) = text.strip_prefix(marker) {
|
if let Some(next) = text.strip_prefix(marker) {
|
||||||
|
if let Some(range) = literal.map_range_up(TextRange::at(offset, TextSize::of(marker))) {
|
||||||
|
hl.add(HlRange { range, highlight: HlTag::Keyword.into(), binding_hash: None });
|
||||||
|
}
|
||||||
|
|
||||||
text = next;
|
text = next;
|
||||||
|
|
||||||
let marker_len = TextSize::of(marker);
|
let marker_len = TextSize::of(marker);
|
||||||
|
@ -40,9 +40,9 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
|
|||||||
<span class="keyword">fn</span> <span class="function declaration">main</span><span class="punctuation">(</span><span class="punctuation">)</span> <span class="punctuation">{</span>
|
<span class="keyword">fn</span> <span class="function declaration">main</span><span class="punctuation">(</span><span class="punctuation">)</span> <span class="punctuation">{</span>
|
||||||
<span class="function">f</span><span class="punctuation">(</span><span class="string_literal">r"</span>
|
<span class="function">f</span><span class="punctuation">(</span><span class="string_literal">r"</span>
|
||||||
<span class="keyword">fn</span> <span class="function declaration">foo</span><span class="punctuation">(</span><span class="punctuation">)</span> <span class="punctuation">{</span>
|
<span class="keyword">fn</span> <span class="function declaration">foo</span><span class="punctuation">(</span><span class="punctuation">)</span> <span class="punctuation">{</span>
|
||||||
<span class="function">foo</span><span class="punctuation">(</span>$0<span class="punctuation">{</span>
|
<span class="function">foo</span><span class="punctuation">(</span><span class="keyword">$0</span><span class="punctuation">{</span>
|
||||||
<span class="numeric_literal">92</span>
|
<span class="numeric_literal">92</span>
|
||||||
<span class="punctuation">}</span>$0<span class="punctuation">)</span>
|
<span class="punctuation">}</span><span class="keyword">$0</span><span class="punctuation">)</span>
|
||||||
<span class="punctuation">}</span><span class="string_literal">"</span><span class="punctuation">)</span><span class="punctuation">;</span>
|
<span class="punctuation">}</span><span class="string_literal">"</span><span class="punctuation">)</span><span class="punctuation">;</span>
|
||||||
<span class="punctuation">}</span>
|
<span class="punctuation">}</span>
|
||||||
</code></pre>
|
</code></pre>
|
Loading…
Reference in New Issue
Block a user