flutter-tools.nvim icon indicating copy to clipboard operation
flutter-tools.nvim copied to clipboard

[Feature] Add interactive Dart Fix command

Open akinsho opened this issue 2 years ago • 2 comments

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

akinsho avatar Oct 14 '21 13:10 akinsho

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

Hannnes1 avatar Feb 26 '24 07:02 Hannnes1

Individual fixes are already supported by the analyzer, they are visible in code actions (see "Rename to 'bodyMedium'"): image

sidlatau avatar Feb 26 '24 07:02 sidlatau