Skip to content

Code folding for switch statements #4506

@stereotype441

Description

@stereotype441

With the addition of patterns to the Dart language, it would be nice if code folding could be used on switch statements, much as it can be used for other control flow such as if statements.

For example, given the code:

switch (expr) {
  case 0:
    statement;
    statement;
    statement;
  case 1:
    statement;
    statement;
    statement;
}

It would be nice to be able to collapse individual cases, e.g.

switch (expr) {
  case 0:case 1:
    statement;
    statement;
    statement;
}

Or to collapse the entire switch statement:

switch (expr) {…
}

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 enhancementrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions