You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Renaming to private is not possible if item is used elsewhere #2745
Got:
Alert appears: Renamed top level variable will be invisible in ''.
There is no option to force the rename.
Expected:
Alert appears: Renamed top level variable will be invisible in main.dart
Alert has "Force" button that renames anyway - I would like to rename and then fix the errors.
This is especially annoying if given item is used 100x times in one file and 10x in other files, because now you have to find all references of it, remove them, and then attempt the rename again. Overall takes much longer than forced rename which we had before.
changed the title [-]Renaming to private is not possible and confusing if item is used elsewhere[/-][+]Renaming to private is not possible if item is used elsewhere[/+]on Sep 24, 2020
Activity
DanTup commentedon Sep 24, 2020
I'm splitting this into two issues, because one is fixed but the other is a bit trickier.
The bad error message is covered by #2818, and this issue is for being able to force the rename.
[-]Renaming to private is not possible and confusing if item is used elsewhere[/-][+]Renaming to private is not possible if item is used elsewhere[/+]DanTup commentedon Oct 14, 2020
Got a fix in progress for LSP at https://dart-review.googlesource.com/c/sdk/+/167621/.
[Analyzer] Ask user whether to proceed with renames that produce errors
DanTup commentedon Oct 14, 2020
Fixed in dart-lang/sdk@ece17f7 and should show up in a future SDK release.