Skip to content

A trailing semicolon is deleted when formatting an enum #61909

@bwilkerson

Description

@bwilkerson

Using VS Code, create a file containing

enum E { a, b }

Place the cursor after the b and type a semicolon. If 'Editor: Format On Type' is enabled and semicolon is a trigger (which I think is the default), the semicolon will be removed by the formatter. This makes it difficult to enter new members.

I understand the rationale for having the formatter remove the trailing semicolon, and I understand the value of having the code formatted when it's likely to be syntactically correct, but in this case the two features clash.

I don't have a good suggestion for how to improve the situation, so I'm looking for ideas.

@munificent @DanTup

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.type-questionA question about expected behavior or functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions