flutter-tools.nvim
flutter-tools.nvim copied to clipboard
[Feature] Add interactive Dart Fix command
I've just discovered the dart fix --apply
and the dart fix --dry-run
commands which can apply all the analyser preview then apply all the analyser fixes.
I think this functionality could be built in to this plugin by showing the results of dry-run
in a floating window then a user could accept the changes or not which would then run apply if they accept the changes.
See: https://flutter.dev/docs/development/tools/flutter-fix
I realize that this is an older issue, but I would just like to add some more information, since it seems like this feature is not present yet.
In addition to dart fix
in the terminal, Vs Code and Android Studio also has the ability to apply fixes to individual warnings / errors. It would be nice to be able to do that in Neovim as well.
Link to the relevant Flutter docs: https://docs.flutter.dev/tools/flutter-fix#applying-individual-fixes
Individual fixes are already supported by the analyzer, they are visible in code actions (see "Rename to 'bodyMedium'"):