Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #12262 - jhgg:fix-whitespace-between-mut-self-in-macro-expansion, r=lnicola
ide: insert whitespace between 'mut' and 'self' in macro expansion fixes #12260
bors 2022-05-15
parent fa133d0 · parent 4efc2a9 · commit 5ae9847
-rw-r--r--crates/ide-db/src/syntax_helpers/insert_whitespace_into_node.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ide-db/src/syntax_helpers/insert_whitespace_into_node.rs b/crates/ide-db/src/syntax_helpers/insert_whitespace_into_node.rs
index e389eaf047..16e609b1a7 100644
--- a/crates/ide-db/src/syntax_helpers/insert_whitespace_into_node.rs
+++ b/crates/ide-db/src/syntax_helpers/insert_whitespace_into_node.rs
@@ -88,6 +88,9 @@ pub fn insert_ws_into(syn: SyntaxNode) -> SyntaxNode {
LIFETIME_IDENT if is_next(is_text, true) => {
mods.push(do_ws(after, tok));
}
+ MUT_KW if is_next(|it| it == SELF_KW, false) => {
+ mods.push(do_ws(after, tok));
+ }
AS_KW | DYN_KW | IMPL_KW | CONST_KW => {
mods.push(do_ws(after, tok));
}