-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Assist to make parameter into named #56855
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
Comments
Summary: The user requests a feature to toggle between named, unnamed, and positional parameter types when adding a new final field to a class with an existing constructor. This would provide more flexibility and control over parameter types. |
We have a refactoring that will do this for you. It's currently marked as experimental, which means that you have to set a flag somewhere in order to have it show up in VS Code (I've forgotten where the flag is but @DanTup will probably remember). |
The setting to enable experimental refactors is: "dart.experimentalRefactors": true, And with it, I see these: params_to_named.mp4 |
I've tested it and it does seem to work. Some final questions:
EditOne thing I noticed was that it also doesn't tell the user about the progress in the refactor just as Dart-Code/Dart-Code#5235. |
#45675 (but I'll note that we're notoriously bad at remembering to go back and close and issue when a feature ships, so it's not clear whether there will be anything to follow).
That's the goal, but it's been a while since we've been able to work on it, so I can't give you a timeframe.
We thought it needed more testing.
Yes, I think this is a duplication.
Agreed, we should probably have some kind of progress notification. |
Inspired by #53707
Today if you add a new final field to a class that already has a constructor you only have the option to add it to the constructor as an (unnamed) positional parameter.
I'd like an assist to toggle between named, unnamed and positional parameter types.
The text was updated successfully, but these errors were encountered: