Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-db/src/syntax_helpers/insert_whitespace_into_node.rs')
| -rw-r--r-- | crates/ide-db/src/syntax_helpers/insert_whitespace_into_node.rs | 4 |
1 files changed, 4 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 b5db8c1967..a06f18543f 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 @@ -114,6 +114,10 @@ pub fn insert_ws_into(syn: SyntaxNode) -> SyntaxNode { ted::insert(pos, insert); } + if let Some(it) = syn.last_token().filter(|it| it.kind() == SyntaxKind::WHITESPACE) { + ted::remove(it); + } + syn } |