dubreuia / intellij-plugin-save-actions

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

"save actions on save" is not work at Intellij 2021.3 (Ultimate Edition) #401

Closed donguseo closed 2 years ago

donguseo commented 2 years ago

Describe the bug After I upgrade my Intellij to 2021.3, "save actions on short cut(cmd + shift + s)" is working properly. But "save actions on save(cmd + s)" is not work.

What triggered the plugin cmd + s

Versions IntelliJ IDEA 2021.3 (Ultimate Edition) Build #IU-213.5744.223, built on November 27, 2021 Licensed to -------- Subscription is active until June 27, 2022. Runtime version: 11.0.13+7-b1751.19 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 11.2.3 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 16 Non-Bundled Plugins: google-java-format (1.13.0.0) de.netnexus.camelcaseplugin (3.0.8) com.mnw.tabmover (1.3.0) com.markskelton.one-dark-theme (5.4.1) com.intellij.plugins.vscodekeymap (213.5744.3) net.ashald.envfile (3.2.2) com.xstudio.com.xstudio.plugin.idea (1.0.13) com.github.leomillon.uuidgenerator (4.5.1) com.dubreuia (2.3.0) com.4lex4.intellij.solarized (2.4.0) ru.adelf.idea.dotenv (2021.3.0.213) com.nvinayshetty.DTOnator (V0.997) zielu.gittoolbox (212.8.4)

Kotlin: 213-1.5.10-release-949-IJ5744.223

fishermans commented 2 years ago

@donguseo I cannot reproduce your issue. Since you are using vscodekeymap: Is cmd+s associated with File / save all?

donguseo commented 2 years ago

image

fishermans commented 2 years ago

@donguseo Save Actions Plugin is hooked into the save document action and not vice versa. Hence, "Save Actions" does not trigger the "Save document" but "Save document" triggers "save actions".

In your screenshot, you can see that you have a shortcut conflict for Command + S. Please click on the warning triangle symbol next to the pen to see which action is also associated to Command + S.

I noticed, that something has been changed in 2021.3 in terms of shortcut management. I my case another plugin was blocking Command + C for copy a file. That plugin was working without trouble in 2021.2.

fishermans commented 2 years ago

One thing to notice. Save Actions will reformat your code on "File / Save All" if activated instead of "Other / Save Document".

It should look like this:

image

See: https://github.com/dubreuia/intellij-plugin-save-actions/blob/fa10815d4a4a56c0bc03db00406673253468ddd3/src/main/java/com/dubreuia/core/listener/SaveActionsDocumentManagerListener.java#L61-L80

donguseo commented 2 years ago

One thing to notice. Save Actions will reformat your code on "File / Save All" if activated instead of "Other / Save Document".

It should look like this:

image

See: https://github.com/dubreuia/intellij-plugin-save-actions/blob/fa10815d4a4a56c0bc03db00406673253468ddd3/src/main/java/com/dubreuia/core/listener/SaveActionsDocumentManagerListener.java#L61-L80

Thank you. your last comment solved my problem !

fishermans commented 2 years ago

Great! Thanks for your feedback.

Could please mark your ticket as closed? I am not able to do since I am just a contributor.

donguseo commented 2 years ago

Thank you for your help!