sdk
sdk copied to clipboard
Missing quickfix "update import" when `hide` is used in `import`

when I comment out hide user

I get the "update import" option, but I think I should also get it when hide User is there.
Agreed. We need to update FixProcessor._addFix_importLibrary_withElement to understand hide clauses.
Another question, what happens when the user tries to expose the 'hidden' function, e.g.
import 'dart:math' hide max show min;
void f() {
max(1, 2);
}
Should we say: Update library import, or Unhide 'max'?
The requester test case:
import 'dart:math' hide atan show min;
void f() {
max(1, 2);
}
should have 'Update library import' to add max, instead of 'Import library'
The labels for a fix (or assist) should describe what it's going to do. We could say "Update import of '
For something like
import 'dart:math' hide max show min;
void f() {
max(1, 2);
}
We actually need to do both: remove the hide clause and add max to the show clause. (I suspect that having both a hide and show clause is rare though, so I'm not sure it's worth having a third message for it.)
We actually need to do both: remove the hide clause and add max to the show clause. (I suspect that having both a hide and show clause is rare though, so I'm not sure it's worth having a third message for it.)
In this case the "update" would be fine I think.
Just to point out: some work related to show is being worked on https://github.com/Dart-Code/Dart-Code/issues/5238.
I just would like to point out that there is an issue for warning when you have either two combinations of show/hide since you only need one to achieve any hiding goal
You never need more than one
showor onehidecombinator to achieve any hiding-goal.
https://dart-review.googlesource.com/c/sdk/+/390630