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

Analyzer quick-fix: Add import with show. #55842

Open
lrhn opened this issue May 25, 2024 · 0 comments
Open

Analyzer quick-fix: Add import with show. #55842

lrhn opened this issue May 25, 2024 · 0 comments
Labels
analyzer-quick-fix area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@lrhn
Copy link
Member

lrhn commented May 25, 2024

The analyzer has a quick-fix, "Import library ...", for adding an import for a name that's not in the current library's scope.

I'd like a variant of that, which adds the same import, but with a show Name added, an Import library ... with show ..., or something like that.

The functionality to add a name to a show clause already exists:

  • I can move the cursor the import and select "add explicit 'show' combinator" which adds the show clause for all already used names, and
  • if I add the show Name myself, then writes the name of another declaration from the same library, I get an "Update library ... import" which adds the name to the show clause.

I just want to avoid moving the cursor away from where I'm writing, and get the show clause from the start.

Example of what I'd want:

void main() {
  Queue/* Press ctrl+. here, select "import library 'dart:collection' with show" */ queue;
  HashMap/* Press ctrl+.here, select "Update library 'dart:collection' import" */ map;
}
@lrhn lrhn added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-quick-fix type-enhancement A request for a change that isn't a bug labels May 25, 2024
@keertip keertip added the P3 A lower priority bug or feature request label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-quick-fix area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants