Skip to content

[analyzer] Code completion incorrectly includes values from all available enums #61161

@incendial

Description

@incendial

Hi,

void pattern(String value) {
  if (value case SomeClass(:final value) || SomeClass(:final value)) {
    print(value); // <-- type here
  }
}

class SomeClass {
  final String value;

  const SomeClass(this.value);
}

when typing print(values, code completion suggests values from all available enum declarations:

Image

Submitting a suggestion has no effect.

Dart SDK version: 3.8.1 (stable) (Wed May 28 00:47:25 2025 -0700) on "macos_arm64"

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-completionIssues with the analysis server's code completion featuretype-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