-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Based on both:
- [analyzer] Confusing behaviour when renaming constructor declarations #61008
- Add a code action on imports to add/remove aliases Dart-Code/Dart-Code#4289
I'd started working on https://dart-review.googlesource.com/c/sdk/+/421543. I'll leave that one for creating the new actions, but it was stale because while developing it I found out that the rename prefix really needs some attention on shadowing, it has basically nothing today (both for removing the name entirely and adding a new name that shadows another declaration).
So this issue is intended to track only the handling of shadowing names when renaming the prefix. I'll remove the work on this that I had started on that CL (last patchset to have this was 4), and later I might come back to this, but if anyone knows better how to handle this and wants to jump on it before I do, please feel completely free to do so.
Here are some examples of tests I had added:
import 'dart:core'; //Try adding `core`
void f() {
var core = 42;
print(core);
}
import 'dart:core' as c^ore;
// Maybe try importing and using too
void print(String s) {}
void f() {
print('Hello, world!');
core.print('Hello, world!');
}
FYI @bwilkerson