Skip to content

Commit 26b5f1f

Browse files
Do not insert a newline after ; if the next token is a }
This creates double newline.
1 parent e295f0c commit 26b5f1f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

crates/ide-db/src/syntax_helpers/insert_whitespace_into_node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pub fn insert_ws_into(syn: SyntaxNode) -> SyntaxNode {
9595
AS_KW | DYN_KW | IMPL_KW | CONST_KW => {
9696
mods.push(do_ws(after, tok));
9797
}
98-
T![;] => {
98+
T![;] if is_next(|it| it != R_CURLY, true) => {
9999
if indent > 0 {
100100
mods.push(do_indent(after, tok, indent));
101101
}

crates/ide/src/hover/tests.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5135,7 +5135,7 @@ fn main() { $0V; }
51355135
```rust
51365136
test
51375137
```
5138-
5138+
51395139
```rust
51405140
pub const V: i8 = {
51415141
let e = 123;
@@ -5162,11 +5162,10 @@ fn main() { $0V; }
51625162
```rust
51635163
test
51645164
```
5165-
5165+
51665166
```rust
51675167
pub static V: i8 = {
51685168
let e = 123;
5169-
51705169
}
51715170
```
51725171
"#]],

0 commit comments

Comments
 (0)