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 on variable destruction can be improved #59854

Open
FMorschel opened this issue Jan 7, 2025 · 1 comment
Open

Auto complete on variable destruction can be improved #59854

FMorschel opened this issue Jan 7, 2025 · 1 comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.

Comments

@FMorschel
Copy link
Contributor

Originally opened at Dart-Code/Dart-Code#5379.


Is your feature request related to a problem? Please describe.
When you have code like this:

void foo(Iterable iterable) {
  if (iterable case List()) {
    
  }
}

When inside List(^) you get prompted by auto-complete for all proprieties the class has. But when you auto-complete, it simply fills the propriety name and not :var isEmpty which is a valid syntax for getting that value (in for in loops you also can do this but the var is then before the Type name). We already have the rename refactor for changing the variable name to a new one if we want to, but I feel like this would help more than harm most of the time.

Describe the solution you'd like
For it to auto-complete with :var before the propriety name (if you know what lints are available maybe we can look at the ones that ask for the final keyword or the type name) on if cases and without the var keyword on for in loops.

@FMorschel FMorschel added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Jan 7, 2025
@FMorschel
Copy link
Contributor Author

@srawlins can you think of any other case where we can have variable destruction like this? Did I forget anything?

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.
Projects
None yet
Development

No branches or pull requests

1 participant