mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
Better highlight for fixtures
This commit is contained in:
parent
62b17bac92
commit
4a8d2c098d
2 changed files with 6 additions and 2 deletions
|
@ -42,6 +42,10 @@ pub(super) fn highlight_injection(
|
|||
offset += TextSize::of(chunk);
|
||||
|
||||
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;
|
||||
|
||||
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="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="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="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>
|
||||
</code></pre>
|
Loading…
Reference in a new issue