mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
fix(ide): highlight escapes in char
This commit is contained in:
parent
e9e57725aa
commit
f0c74b30ed
4 changed files with 55 additions and 4 deletions
|
@ -21,8 +21,11 @@ use syntax::{
|
|||
|
||||
use crate::{
|
||||
syntax_highlighting::{
|
||||
escape::highlight_escape_string, format::highlight_format_string, highlights::Highlights,
|
||||
macro_::MacroHighlighter, tags::Highlight,
|
||||
escape::{highlight_escape_char, highlight_escape_string},
|
||||
format::highlight_format_string,
|
||||
highlights::Highlights,
|
||||
macro_::MacroHighlighter,
|
||||
tags::Highlight,
|
||||
},
|
||||
FileId, HlMod, HlOperator, HlPunct, HlTag,
|
||||
};
|
||||
|
@ -427,6 +430,14 @@ fn traverse(
|
|||
if let Some(byte_string) = ast::ByteString::cast(token) {
|
||||
highlight_escape_string(hl, &byte_string, range.start());
|
||||
}
|
||||
} else if ast::Char::can_cast(token.kind())
|
||||
&& ast::Char::can_cast(descended_token.kind())
|
||||
{
|
||||
let Some(char) = ast::Char::cast(token) else {
|
||||
continue;
|
||||
};
|
||||
|
||||
highlight_escape_char(hl, &char, range.start())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue