Open hankhsu1996 opened 2 years ago
BTW I use the default verible-verilog-format
format command.
Can you please provide details about the editor you are using and the verible-verilog-format verison. Thanks
$ verible-verilog-format --version
v0.0-2152-gdd5e91a4
Commit 2022-05-23 14:53:23 -0700
Built 2022-05-23T22:18:27Z
$ code --version
1.68.1
30d9c6cd9483b2cc586687151bcbcd635f373630
x64
I would guess it's line 65 in svformatter.ts
. The formatter only replace from the first character in the file to the first character of the last line. However, I haven't tested it yet.
Maybe you can use Range(document.lineAt(0).range.start, document.lineAt(document.lineCount-1).range.end)
.
Thanks. I am able to reproduce the error. Looks like the output range is excluding the last line. Should be fixed in next release.
If I format a file with no trailing new line, the last line will be duplicated.
For example,
Would become: