Skip to content

Code block folding for enum #3225

@Luckey-Elijah

Description

@Luckey-Elijah

Is your feature request related to a problem? Please describe.
With most code blocks contained in curly braces ({}), you are able to collapse/fold them. With an enum (that can take up multiple lines with trailing commas or otherwise), you are unable to fold these "blocks".

Describe the solution you'd like
I'd like to be able to fold an dart enum in VS Code.

enum LoremIpsum {
  dolor,
  sit,
  amet,
  consectetur,
  adipiscing,
  elit,
  sed,
  eiusmod,
  tempor,
  incididunt,
  ut,
  labore,
}

to

enum LoremIpsum {...
}

Describe alternatives you've considered
I've looked around at some settings, but I can't seem to find any obvious rules/settings to enable this behavior.

Additional context
In unsaved documents (Untitled-1-like) I am able to fold them with Dart language mode on. But once I save them as a .dart file, the option is gone. See images below.

Before saving file:

Before saving file

Can fold:

Can fold

After saving file:

After saving file

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions