xdev-software/intellij-plugin-save-actions

trouble with config load and save

delanym opened this issue · 9 comments

When I navigate to Other Settings > Save Actions and configure Use external Eclipse configuration file (.epf) the path is populated, but no other config is populated in the dialog.

If I click OK and then return to the settings, all config is lost including the path to the config file.

To get config to load and save I need to select the configuration file and then check "Activate save actions on save". The config from the config file populates the dialog on clicking Apply.

Thank you for the report.

I checked this and could reproduce the problem that clicking OK doesn't do the same as Apply.

However the epf file is still present in the options after closing. Could you provide a sample epf file?

So I think the problem with the OK/Apply originates from

public void apply() {
for (Map.Entry<Action, JCheckBox> checkbox : checkboxes.entrySet()) {
storage.setEnabled(checkbox.getKey(), checkbox.getValue().isSelected());
}
storage.setExclusions(new HashSet<>(exclusions));
storage.setInclusions(new HashSet<>(inclusions));
storage.setQuickLists(new ArrayList<>(quickLists));
storage.setConfigurationPath(ideSupport.getPath());
Storage efpStorage = EpfStorage.INSTANCE.getStorageOrDefault(ideSupport.getPath(), storage);
updateSelectedStateOfCheckboxes(efpStorage.getActions());
updateCheckboxEnabled(null);
}

When Apply+OK is clicked this code is executed twice. However when just ok is clicked it's only executed once and therefore the updated UI values from the EPF file are not written back into the config.

However these written values are ignored anyway, as can be seen here:

JAVA(project -> {
Storage defaultStorage = DEFAULT.getStorage(project);
return EpfStorage.INSTANCE.getStorageOrDefault(defaultStorage.getConfigurationPath(), defaultStorage);
});

The values are read directly from the EPFStorage.


Conclusion

When I navigate to Other Settings > Save Actions and configure Use external Eclipse configuration file (.epf) the path is populated, but no other config is populated in the dialog.

It's populated when you click "Apply".

If I click OK and then return to the settings, all config is lost including the path to the config file.

To get config to load and save I need to select the configuration file and then check "Activate save actions on save". The config from the config file populates the dialog on clicking Apply.

As mentioned above I need a sample epf file that causes the problem because with the example files - that are used for testing - everything works fine.

Please also send details what IDE/plugin version you are using.

eclipse-codecleanup-config.zip

IntelliJ IDEA 2023.2 (Ultimate Edition)
Build #IU-232.8660.185, built on July 26, 2023
Runtime version: 17.0.7+7-b1000.6 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0
Jenkins Plugin 0.13.18-2023.2
GC: G1 Young Generation, G1 Old Generation
Memory: 4074M
Cores: 12
Registry:
debugger.new.tool.window.layout=true
documentation.show.toolbar=true
caches.scanningThreadsCount=4
ide.experimental.ui=true
ide.balloon.shadow.size=0

Non-Bundled Plugins:
com.github.mikesafonov.jenkins-linter-idea-plugin (0.6.0)
com.jetbrains.darkPurpleTheme (1.3)
com.jetbrains.plugins.ini4idea (232.8660.205)
ru.meanmail.plugin.requirements (2022.4.1)
mobi.hsz.idea.gitignore (4.5.1)
EclipseCodeFormatter (23.2.223.000.0-Eclipse_2023-03)
Jenkins Control Plugin (0.13.18-2023.2)
software.xdev.saveactions (1.0.2)
com.intellij.aspectj (232.8660.142)
CheckStyle-IDEA (5.82.0)
com.cursiveclojure.cursive (1.13.1-eap2-2023.2)

Kotlin: 232-1.9.0-IJ8660.185

I don't know if this is related but sometimes the configuration deactivates without warning

I rechecked with your config and I again can't find any problems:

ipsa_24_1.webm

Formatting with clicking apply or just ok works fine.

As I can't reproduce why your problems happen I think they are not related to the plugin itself. You may check the following:

  • Maybe another plugin (or it's configuration) interferes with this one
  • Maybe the file is located somewhere where it's not always available for IntelliJ (e.g. when on a network drive)

We can have a look at this again once there is new meaningful information available.

Please reopen once there is new meaningful information available :)

Hi, I'm having issues again after upgrading to IDEA 2023.3 (Build #IU-233.11799.241, built on December 2, 2023)
The epf is fine, but the Java Inspections and Quick Fix checkboxes keep reverting.
The "Add a serialVersionUID field..." is particularly annoying as the code it inserts

      @Serial
      private static final long serialVersionUID = 8579008803775307520L;

is only valid for JDK14+
I have to turn the plugin off (version 1.0.5)

I tried restarting, clearing all the caches, uninstalling and reinstalling the plugin. I uninstalled again, but this time I removed ~/.local/share/JetBrains/IntelliJIdea2023.3/Save Actions - XDEV Edition. For some reason uninstalling doesn't remove this.
I reinstalled it, and it STILL remembers where my epf file is. What's more, the serialization checkbox is now disabled, but when I save it adds the @serial stuff. Christ this thing is annoying!
I should mention when I first upgraded to 2023.3 Intellij lost all my plugins so I reverted and tried some days later and then it upgraded with all the plugins and their config.

I just read the followup comments now. Some ideas from my side:

Looks like some kind of OS/IDE install problem to me.... maybe incorrect permissions on a folder or something or maybe if it's checked into git, but ignored and is getting kept reverted?
You could also try if this happening on another computer (at best in a fresh install environment)

Also the path above is UNIX based (I assume your OS is macOS or Linux) but in the one of the reports above you stated that your OS is Windows 10?

I reinstalled it, and it STILL remembers where my epf file is.

That's because it's tracked inside the .idea folder of the repository/workspace.

Anyway I still can't do much other than speculation without a reproducible example...