Skip to content

Commit

Permalink
Do not insert a newline after ; if the next token is a }
Browse files Browse the repository at this point in the history
This creates double newline.
  • Loading branch information
ChayimFriedman2 committed Sep 4, 2022
1 parent e295f0c commit 26b5f1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub fn insert_ws_into(syn: SyntaxNode) -> SyntaxNode {
AS_KW | DYN_KW | IMPL_KW | CONST_KW => {
mods.push(do_ws(after, tok));
}
T![;] => {
T![;] if is_next(|it| it != R_CURLY, true) => {
if indent > 0 {
mods.push(do_indent(after, tok, indent));
}
Expand Down
5 changes: 2 additions & 3 deletions crates/ide/src/hover/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5135,7 +5135,7 @@ fn main() { $0V; }
```rust
test
```
```rust
pub const V: i8 = {
let e = 123;
Expand All @@ -5162,11 +5162,10 @@ fn main() { $0V; }
```rust
test
```
```rust
pub static V: i8 = {
let e = 123;
}
```
"#]],
Expand Down

0 comments on commit 26b5f1f

Please sign in to comment.