mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
fix: insert whitespace between text and pound
`text#`, `text"..."`, and `text'...'` are reserved syntax since Rust 2021. Note that the latter two are already handled correctly.
This commit is contained in:
parent
a6464392c1
commit
0df9fb22d8
2 changed files with 48 additions and 1 deletions
|
@ -60,7 +60,9 @@ pub fn insert_ws_into(syn: SyntaxNode) -> SyntaxNode {
|
|||
|f: fn(SyntaxKind) -> bool, default| -> bool { last.map(f).unwrap_or(default) };
|
||||
|
||||
match tok.kind() {
|
||||
k if is_text(k) && is_next(|it| !it.is_punct() || it == UNDERSCORE, false) => {
|
||||
k if is_text(k)
|
||||
&& is_next(|it| !it.is_punct() || matches!(it, T![_] | T![#]), false) =>
|
||||
{
|
||||
mods.push(do_ws(after, tok));
|
||||
}
|
||||
L_CURLY if is_next(|it| it != R_CURLY, true) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue