Skip to content

improve the behavior of format on poorly formed files #1413

Open
@devoncarew

Description

@devoncarew

When editing in build() methods, if the braces/parens aren’t balanced, hitting format will destroy the file. When you go to hit undo, IntelliJ asks if you want to undo through the format operation (which breaks your flow, to have to answer a dialog).

And for context, it's very easy when refactoring build methods - adding, removing, and reordering widgets - to get into a state where the parens are unbalanced.

oct-23-2017 07-47-25

We should:

  • verify that intellij is using the analysis server for formatting when the file is mis-formed
  • follow up with dartfmt about being able to format bad files
  • have intellij not ask about undoing through a format operation
  • possibly, make the IntelliJ formatter (not dartfmt) format better when there are unbalanced (possibly related to https://youtrack.jetbrains.com/issue/WEB-28954)

/cc @alexander-doroshko @jwren

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions