Skip to content

Poor error recovery when typing an annotation at the end of a class body #42725

Open
@bwilkerson

Description

@bwilkerson

Given a file with the following content:

class Foo {
  @Export
}
class Export {
  const Export();
}

the annotation at the end of the class Foo will be discarded when using the analyzer. There isn't currently any place to hang this annotation in the AST, but we need to create one.

I don't know whether the parser will generate the necessary callbacks to capture the information, but if not then it needs to be fixed as well.

This impacts users when attempting to type an annotation before a soon-to-be-added member, and causes code completion to replace the wrong range of characters when it's used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4analyzer-recoveryarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.model-error-recoveryError recovery in analyzer/CFE.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions