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

Broken/unexpected formatting of comments after members #2279

Open
milesziemer opened this issue May 8, 2024 · 0 comments
Open

Broken/unexpected formatting of comments after members #2279

milesziemer opened this issue May 8, 2024 · 0 comments
Labels
bug This issue is a bug.

Comments

@milesziemer
Copy link
Contributor

  1. Trailing comments get moved to a weird spot:
structure A {
    a: String // a
}

becomes

structure A {
    a: String

    // a
}
  1. With default value assignments, you get an extra newline if you had a trailing comment in the shape body:
structure A {
    a: String = ""
    // a
}

becomes:

structure A {
    a: String = ""

    // a

}
  1. Invalid doc comments also aren't fixed if they come after a default value assignment:
structure A {
    a: String = "" /// a
}

structure B {
    b: String = ""
    /// a
}

don't change.

Not sure about 1, but for 2 and 3, it has something to do with the fact that ValueAssignment contains all whitespace following it (through BR)

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

No branches or pull requests

2 participants