Skip to content

v fmt wrongly remove "//" on comment. #23607

@Bruno-Vdr

Description

@Bruno-Vdr
V version: V 0.4.9 1197615, press to see full `v doctor` output
V full version V 0.4.9 b114254.1197615
OS linux, Debian GNU/Linux trixie/sid
Processor 24 cpus, 64bit, little endian, 12th Gen Intel(R) Core(TM) i9-12950HX
Memory 6.45GB/15.31GB
V executable /home/vedder/v/v
V last modified time 2025-01-29 07:36:36
V home dir OK, value: /home/vedder/v
VMODULES OK, value: /home/vedder/.vmodules
VTMP OK, value: /tmp/v_1000
Current working dir OK, value: /home/vedder/Bruno-Archive/Development/V/interface/src
Git version git version 2.45.2
V git status weekly.2025.03-54-g1197615b-dirty
.git/config present true
cc version cc (Debian 14.2.0-12) 14.2.0
gcc version gcc (Debian 14.2.0-12) 14.2.0
clang version N/A
tcc version tcc version 0.9.28rc 2024-07-31 HEAD@1cee0908 (x86_64 Linux)
tcc git status thirdparty-linux-amd64 0134e9b9
emcc version N/A
glibc version ldd (Debian GLIBC 2.40-5) 2.40

What did you do?
v fmt -w main.v

module main

pub interface Command {
	name    string // Command name as used on CLI
	desc    string // Single line description
	help    string // Detailed and formated description
	arg_min int    // Minimal argument number expected
	arg_max int    // Maximal argument number expected
	exec    fn (s []string) ! // Command callback.
}

fn main() {
	println('Hello')
}

What did you see?

When running v fmt -w on this file, the "//" in front of 'Command callback' comment are removed, breaking the next compilation.

What did you expect to see?

No change when running v fmt -w on this file.

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Metadata

Metadata

Assignees

Labels

BugThis tag is applied to issues which reports bugs.Status: ConfirmedThis bug has been confirmed to be valid by a contributor.Unit: ParserBugs/feature requests, that are related to the V parser or syntax (*not* semantic ones).Unit: vfmtBugs/feature requests, that are related to the `vfmt`, the formatter for V.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions