-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fmt: fix enum/struct_decl/struct_init fields with empty newlines
- Loading branch information
Showing
12 changed files
with
111 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import time // foo | ||
|
||
/* | ||
block | ||
comment | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
enum Info { | ||
aa = 1 // aa | ||
bbb // bbb | ||
|
||
cccc = 5 /* cccc | ||
--- cccc | ||
*/ | ||
ddddd = 10 // ddddd | ||
|
||
// before | ||
ee = 20 | ||
fff = 30 | ||
|
||
// before comment1 | ||
// before comment2 | ||
gg | ||
} | ||
|
||
fn main() {} |
17 changes: 17 additions & 0 deletions
17
vlib/v/fmt/tests/struct_decl_with_newline_and_comments_keep.vv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module main | ||
|
||
fn main() { | ||
} | ||
|
||
pub struct OperateInfo { // implements IperateInfo | ||
pub mut: | ||
title string // title | ||
|
||
// msg, id | ||
msg string // msg | ||
id string // id | ||
|
||
// other1 | ||
// other2 | ||
other string | ||
} // operate info |
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
vlib/v/fmt/tests/struct_init_with_newline_and_comments_2_keep.vv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module abcde | ||
|
||
pub struct Builder { | ||
pub mut: | ||
// inline before field | ||
buf []u8 | ||
str_calls int | ||
len int | ||
initial_size int = 1 | ||
} | ||
|
||
pub fn new_builder(initial_size int) Builder { | ||
return Builder{ | ||
// buf: make(0, initial_size) | ||
buf: []u8{cap: initial_size} | ||
|
||
// before comment | ||
str_calls: 0 // after str_calls | ||
len: 0 // after len | ||
|
||
// before comment1 | ||
// before comment2 | ||
initial_size: initial_size // final | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters