Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter eats comments on the first argument of a function #6661

Closed
cknitt opened this issue Feb 29, 2024 · 4 comments · Fixed by #6763
Closed

Formatter eats comments on the first argument of a function #6661

cknitt opened this issue Feb 29, 2024 · 4 comments · Fixed by #6763

Comments

@cknitt
Copy link
Member

cknitt commented Feb 29, 2024

Example (tested with 11.0.1):

  external test: (
    // comment
    ~x: int,
  ) => unit = "test"

gets reformatted to

external test: (~x: int) => unit = "test"
@fhammerschmidt
Copy link
Contributor

This appears to be a regression since 11.0.0

@cknitt cknitt changed the title Formatter eats comments on labeled arguments Formatter eats comments on the first argument of a function Feb 29, 2024
@cknitt
Copy link
Member Author

cknitt commented Feb 29, 2024

Also happens for non-labeled arguments. But only for the first argument of the function.

E.g.,

  external test: (
    // comment
    int,
    // comment
    int,
  ) => unit = "test"

gets reformatted to

external test: (
  int,
  // comment
  int,
) => unit = "test"

@shulhi
Copy link
Contributor

shulhi commented Mar 1, 2024

I can work on this, I wonder if it's a regression after my PR here #6615

@cknitt
Copy link
Member Author

cknitt commented Mar 2, 2024

@shulhi That would be great, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants