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 completion doesn't suggest enum values when imported aliased #56056

Closed
FMorschel opened this issue Jun 20, 2024 · 1 comment
Closed

Code completion doesn't suggest enum values when imported aliased #56056

FMorschel opened this issue Jun 20, 2024 · 1 comment
Assignees
Labels
analyzer-completion Issues with the analysis server's code completion feature analyzer-completion-correctness analyzer-server area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@FMorschel
Copy link
Contributor

FMorschel commented Jun 20, 2024

When writing this:

enum.dart

enum A {
  a,
  b,
  c;
}

void func(A a) {}

main.dart

import 'enum.dart' as a;

void main() {
  a.func(a.A.);
}

This happens:
code completion suggesting A.new

If you remove the alias it works just fine.

Dart info:

#### General info

- Dart 3.5.0-254.0.dev (dev) (Wed Jun 12 05:04:01 2024 -0700) on "windows_x64"
- on windows / "Windows 10 Pro" 10.0 (Build 22631)
- locale is pt-BR

#### Project info

- sdk constraint: '>=3.3.0 <4.0.0'
- dependencies: test
- dev_dependencies: dart_code_metrics, lints
@dart-github-bot
Copy link
Collaborator

Summary: Code completion fails to suggest enum values when the enum is imported with an alias. The issue occurs when attempting to access enum values within a function call using the aliased import, resulting in only A.new being suggested.

@dart-github-bot dart-github-bot added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jun 20, 2024
@scheglov scheglov added analyzer-completion Issues with the analysis server's code completion feature analyzer-server analyzer-completion-correctness P2 A bug or feature request we're likely to work on labels Jun 21, 2024
@keertip keertip self-assigned this Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-completion Issues with the analysis server's code completion feature analyzer-completion-correctness analyzer-server area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants