fmt: trim space in embedded comments (#7521)
parent
9d1365ec67
commit
fec9f1324c
|
@ -1228,7 +1228,7 @@ pub fn (mut f Fmt) comment(node ast.Comment, options CommentsOptions) {
|
||||||
f.writeln(x)
|
f.writeln(x)
|
||||||
f.write('*/')
|
f.write('*/')
|
||||||
} else {
|
} else {
|
||||||
f.write('/* $x */')
|
f.write('/* ${x.trim(' ')} */')
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,10 @@ fn main() {
|
||||||
d := c // and an extra one
|
d := c // and an extra one
|
||||||
e := c
|
e := c
|
||||||
// more comments = more good
|
// more comments = more good
|
||||||
|
arr := [
|
||||||
|
/* block foo bar */ /* inline foo bar */
|
||||||
|
0,
|
||||||
|
]
|
||||||
// before arg comment
|
// before arg comment
|
||||||
// after arg comment
|
// after arg comment
|
||||||
println('this is a test')
|
println('this is a test')
|
||||||
|
|
|
@ -12,6 +12,11 @@ fn main() {
|
||||||
d := c // and an extra one
|
d := c // and an extra one
|
||||||
e := c
|
e := c
|
||||||
// more comments = more good
|
// more comments = more good
|
||||||
|
arr := [
|
||||||
|
/* block foo bar */
|
||||||
|
// inline foo bar
|
||||||
|
0,
|
||||||
|
]
|
||||||
println(/* before arg comment */ 'this is a test' /* after arg comment */)
|
println(/* before arg comment */ 'this is a test' /* after arg comment */)
|
||||||
if /* before if expr */ true /* after if expr */ {
|
if /* before if expr */ true /* after if expr */ {
|
||||||
println('if')
|
println('if')
|
||||||
|
|
Loading…
Reference in New Issue