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

Code block folding for enum #3225

Closed
Luckey-Elijah opened this issue Mar 22, 2021 · 1 comment
Closed

Code block folding for enum #3225

Luckey-Elijah opened this issue Mar 22, 2021 · 1 comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is enhancement
Milestone

Comments

@Luckey-Elijah
Copy link

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

@DanTup DanTup added this to the v3.22 milestone Mar 23, 2021
@DanTup DanTup added in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server labels Mar 23, 2021
dart-bot pushed a commit to dart-lang/sdk that referenced this issue Apr 27, 2021
Fixes Dart-Code/Dart-Code#3225.

Change-Id: I90aae85c2aaaa034b8190c5bfe1ab66fe6fc0e74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197044
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
@DanTup
Copy link
Member

DanTup commented Apr 27, 2021

Done in dart-lang/sdk@bb8b265.

@DanTup DanTup closed this as completed Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is enhancement
Projects
None yet
Development

No branches or pull requests

2 participants