Open markclemons opened 1 year ago
another option is to disable the file explorer context menu option and only allow refactoring from the open file by right clicking on the object we want to refactor.
@stefanhk31 what do you think we should do?
@markclemons I kind of like the idea of refactoring by right clicking on the object, but we'd have to figure out what object(s) in a file trigger this option's availability. If there's a good way to do that, I'm all ears.
@markclemons after looking into this, I think this is the workflow we should go for:
I could be talked into a confirmation prompt between 4 &5 (something like "Renaming 'Widget' to 'NewWidget'. Proceed?")
Using the file explorer context menu to ask the user to rename the class we blindly assume there is only one class in the file. if we have multiple objects in a file we should consider asking the user if they want to rename each object in the file... consider the following file:
my_class.dart
enum Helper { someValue }
class MyClass { }
mixin MyMixin { }
The current behavior is to replace the first instance we encounter, in this case the enum, that means the file name changes to the new enum name, when really we had the file named for the class.