Open ragurney opened 2 years ago
Since IntelliJ 2021.2 Jetbrains added support for Actions on Save under Preferences/Settings | Tools | Actions on Save
. I wonder if plugins can contribute to that list of actions 🤔
I'll have to look into it! I'm still stuck on v2021.1 at work unfortunately so I would like to make something that works for at least that version as well
Maybe this plugin might be helpful to look at: https://github.com/dubreuia/intellij-plugin-save-actions
I was able to use File Watchers to run ./gradlew spotlessApply
on save. Need to install File Watchers plugin. You can run any command. Note - Needs to be configured for every repo.
Thanks @ln-12 and @melissachang! Yes there are a couple plugins you can use in concert with this plugin to get format on save -- save actions is one I've been currently using. I would love to make this a bundled feature in this plugin though. I'm currently quite busy getting ready to move across the country but will try to get to implementing this in the near future.
There are extensionpoints (ActionOnSave and ActionOnSaveInfoProvider) which can be used PlatformExtensionPoints
Thanks @oraum! I've been dealing with a crosss-country move so haven't had time to invest into this yet. I'd be happy to accept a PR for this, or can likely work on it myself in the next month or so.
Any updates on this topic? It is the main reason people use formatters, they want to see the formatted code.
And there is no plugin for intellij yet, using the OnActionSave extension point for spotless.
Any updates on this topic?
This entails:
Reformat Code with Spotless
on save