Skip to content

vfmt unwrapps long, multiline func signatures to a single line #15545

Closed

Description

@effinsky

V doctor output:

OS: macos, macOS, 12.2.1, 21D62
Processor: 10 cpus, 64bit, little endian, Apple M1 Pro
CC version: Apple clang version 13.1.6 (clang-1316.0.21.2.5)

getwd: /Users/---/code/vlang/vlang_1
vmodules: /Users/---/.vmodules
vroot: /Users/---/v
vexe: /Users/---/v/v
vexe mtime: 2022-08-26 08:59:05
is vroot writable: true
is vmodules writable: true
V full version: V 0.3.0 b0e7ddf.3af1227

Git version: git version 2.32.1 (Apple Git-133)
Git vroot status: weekly.2022.34-28-g3af12271
.git/config present: true
thirdparty/tcc status: thirdparty-macos-arm64 173c526

What did you do?

I wrote a func with a sig so long, I wanted to try and wrap it so as to place each param on a single line, with trailing commas.

What did you expect to see?

I expected vfmt, as per its seeing current impl, to respect the formatting.

Screenshot 2022-08-26 at 11 44 53

What did you see instead?

Instead it formatted the code by placing the arguments on a single line and making the line super long.

Screenshot 2022-08-26 at 11 45 25

Activity

  1. added
    BugThis tag is applied to issues which reports bugs.
    on Aug 26, 2022
  2. added a commit that references this issue on Jul 2, 2024
    209063f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThis tag is applied to issues which reports bugs.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions