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: comments in single-line type definitions all moved to first line of definition #1610

Closed
alex-snezhko opened this issue Jan 18, 2023 · 0 comments · Fixed by #1976
Closed
Assignees
Labels
bug grainfmt Issues related to the Grain formatter

Comments

@alex-snezhko
Copy link
Member

If I compress type definitions down to one line like:

enum E { A(Number, Number), /* first */ B(Number, Number), /* second */ }
record R { a: Number /* first */, b: Number /* second */ }

Then it gets formatted as

enum E { /* first */ /* second */
  A(Number, Number),
  B(Number, Number),
}
record R { /* first */ /* second */
  a: Number,
  b: Number,
}

When perhaps it may be more appropriate to format it like

enum E {
  A(Number, Number), /* first */
  B(Number, Number), /* second */
}
record R {
  a: Number, /* first */
  b: Number, /* second */
}
@phated phated moved this to Todo in Grain v0.6.0 Jan 18, 2023
@phated phated self-assigned this Feb 16, 2023
@spotandjake spotandjake added bug grainfmt Issues related to the Grain formatter labels Mar 1, 2023
@phated phated moved this from Todo to In Progress in Grain v0.6.0 Apr 16, 2023
@phated phated assigned ospencer and unassigned phated and marcusroberts Feb 1, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Grain v0.6.0 Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug grainfmt Issues related to the Grain formatter
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants