dubreuia / intellij-plugin-save-actions

Supports configurable, Eclipse like, save actions, including "organize imports", "reformat code" and "rearrange code".
MIT License
529 stars 102 forks source link

Custom settings based on file type #350

Closed sebkur closed 3 years ago

sebkur commented 3 years ago

I've seen #348 and understand that I can disable formatting for file types completely based on their extension or path. What I'm looking for would be an option to enable / disable certain formatting actions based on the file type. I think it is not possible yet, is it?

To give you an idea, why I need this: I'm using Android Studio and need "Rearrange fileds and methods" to be enabled for XML files, because canonical element attribute order is very desirable there. However I do not want to rearrange Java source files, because this messes up the (non-normalized) order of fields we use in our project. I know I can navigate to the Arrangement tab in EditorCode StyleJava and minimize the arrangement applied to Java files, however it seems impossible to disable rearrangment there completely.

dubreuia commented 3 years ago

@sebkur Thank you for your interest in the plugin, sorry it took me so long to answer. This is a great idea for a feature, but this is also hard to implement. The save-actions engine can support that, but the UI will be hard to make.

I'm accepting PRs if you want to implement it, please see the CONTRIBUTE.md file in the repo. Cheers

dubreuia commented 3 years ago

Move to https://github.com/dubreuia/intellij-plugin-save-actions/projects/2 (ideas)