Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ActionUpdateThread deprecation error for IntelliJ 2024.x+ #1631

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vnoctem
Copy link

@vnoctem vnoctem commented Sep 26, 2024

This PR fixes the deprecation of ActionUpdateThread.OLD_EDT, which causes errors like this in IntelliJ IDEA 2024.x+:

com.intellij.diagnostic.PluginException: `ActionUpdateThread.OLD_EDT` is deprecated and going to be removed soon. 'org.jetbrains.plugins.spotbugs.actions.ClearAndCloseToolWindow' must override `getActionUpdateThread()` and chose EDT or BGT. See ActionUpdateThread javadoc. [Plugin: org.jetbrains.plugins.spotbugs]
	at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
	at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:90)
	at com.intellij.diagnostic.PluginException.reportDeprecatedUsage(PluginException.java:125)
	at com.intellij.openapi.actionSystem.ActionUpdateThreadAware.getActionUpdateThread(ActionUpdateThreadAware.java:21)
	at com.intellij.openapi.actionSystem.AnAction.getActionUpdateThread(AnAction.java:201)

To resolve this, I've overridden getActionUpdateThread() in AbstractAction and AbstractToggleAction, defaulting to EDT for actions that involve UI interactions. However, I haven’t extensively tested all actions, and feedback on whether some should run on BGT would be appreciated.

The fix is backwards compatible with IntelliJ IDEA 2022.2 (222.3345.118 build) and higher and should take care of the deprecation errors in 2024.x.

Issues related

Fix #1627, Fix #1624, Fix #1622, Fix #1612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant