gdelmas / IntelliJDashPlugin

A smart and simple plugin that provides keyboard shortcut access for Dash, Velocity or Zeal in IntelliJ IDEA, RubyMine, WebStorm, PhpStorm, PyCharm and Android Studio.
MIT License
1.09k stars 73 forks source link

PluginException: `ActionUpdateThread.OLD_EDT` is deprecated #88

Open medmunds opened 6 months ago

medmunds commented 6 months ago

Apparently the Dash plugin needs an update for newer JetBrains IDEs: "'de.dreamlab.dash.SmartSearchAction' must override `getActionUpdateThread` and chose EDT or BGT. See ActionUpdateThread javadoc."

I've started getting the following exception in IDE Internal Errors, repeatedly:

Exception in plugin Dash (3.3). … Please report the problem to Gerard Delmàs. stacktrace.txt:

com.intellij.diagnostic.PluginException: `ActionUpdateThread.OLD_EDT` is deprecated and going to be removed soon. 'de.dreamlab.dash.SmartSearchAction' must override `getActionUpdateThread` and chose EDT or BGT. See ActionUpdateThread javadoc. [Plugin: com.paperetto.dash]
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:199)

(Might be related to #87.)

s2k commented 6 months ago

Seeing the same in 'RubyMine 2024.1 Build #RM-241.14494.234`

alperyazgan commented 6 months ago

Same with the PhpStorm

PhpStorm 2024.1
Build #PS-241.14494.237, built on March 27, 2024
Runtime version: 17.0.10+8-b1207.12 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.4.1
...
Non-Bundled Plugins:
  com.paperetto.dash (3.3)
...
medmunds commented 5 months ago

This error will likely show up in the 2024.1 version of every JetBrains IDE. They share a common plugin API.

It looks like the deprecation was first added in the 2022.3 quarterly releases (so, a little less than two years ago). I don't know whether "going to be removed soon" means 2024.2 or 2025.1, but when that occurs the plugin will probably be completely broken.

I think the fix may be as simple as adding getActionUpdateThread to the plugin's shared AbstractMenuAction class:

Index: src/de/dreamlab/dash/AbstractMenuAction.java
===================================================================
@@ -54,4 +54,9 @@

         presentation.setEnabled(PlatformDataKeys.EDITOR.getData(e.getDataContext()) != null);
     }
+
+    @Override
+    public @NotNull ActionUpdateThread getActionUpdateThread() {
+        return ActionUpdateThread.BGT;
+    }
 }

(But it's a very long time since I've done any Java coding, and I'm not set up to build JetBrains plugins to test it.)

mrclrchtr commented 1 month ago

I tried Dash the first time today and could not open the IntelliJ Plugin because of this issue.