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

Auto complete shows too many suggestions on types that have custom extension methods/properties #56760

Closed
ManuelRauber opened this issue Sep 20, 2024 · 3 comments
Labels
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)

Comments

@ManuelRauber
Copy link

Steps to reproduce

  1. Open the project using Android Studio.
  2. Open lib/package-c/example-c.dart.
  3. Within the method just start typing c.hasContent and observe the auto complete suggestions:
    image

The auto complete shows too many completion suggestions.
There should only be the last one.
The other two suggestions are just files importing the extensions as well, but not (re-) exporting them.
If you create more files importing the extensions the more suggestions you will get.

Expected result:

I expect only to see the correct import of the file that also exports the extensions.

Actual result:

I see suggestions of files that only import the extensions for their own usage.

Additional information

Here is a GitHub Repo with an example to test yourself.

Used versions

  • Android Studio Koala Feature Drop | 2024.1.2 Patch 1 (Build #AI-241.19072.14.2412.12360217)
  • Dart: 3.5.2
  • Dart Plugin Version: 241.18968.26
@dart-github-bot
Copy link
Collaborator

Summary: The issue is that Dart's auto-complete suggests too many imports when using custom extension methods/properties. It suggests files that import the extensions but don't re-export them, leading to an excessive number of suggestions.

@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 Sep 20, 2024
@FMorschel
Copy link
Contributor

I have a feeling this is the same as #56320. Please take a look.

@ManuelRauber
Copy link
Author

@FMorschel Oh, you're right! It was my fault; I was only searching for open issues, so I did not see a report or a fix that would ship soon. Thanks for pointing that out! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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)
Projects
None yet
Development

No branches or pull requests

3 participants