I'd like to develop a plugin which is able to reformat code by executing a bash/gradle command e.g. `./gradlew formatApply` on file save or via menu item select. This command can either change the file passed in directly or else output the result to stdout.
My questions are:
- What 'type' of plugin is this? Should this be an 'action' that just executes the command, or else an 'external code formatter '(https://plugins.jetbrains.com/docs/intellij/code-formatting.html#external-code-formatter)?
- Is there documentation out there telling me what properties certain classes have? For example, how would I get the absolute path of a file in an action / external formatter?
- For this, would it be possible to 'override' the included "Reformat code" functionality in Intellij, either by replacing it or disabling 'format on save' automatically when the plugin is added? Or should I just have it as a separate action?
Thank you for the help!