show-comment icon indicating copy to clipboard operation
show-comment copied to clipboard

IDEA 2024.1 ActionUpdateThread.OLD_EDT

Open FunnyCavy opened this issue 10 months ago • 1 comments

com.intellij.diagnostic.PluginException: `ActionUpdateThread.OLD_EDT` is deprecated and going to be removed soon. 'io.github.linwancen.plugin.show.LineEndAdd' must override `getActionUpdateThread` and chose EDT or BGT. See ActionUpdateThread javadoc. [Plugin: io.github.linwancen.show-comment]
	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)

FunnyCavy avatar Apr 06 '24 01:04 FunnyCavy

这个报错不影响使用,是因为新版 IDEA 要求 update 方法必须指定是 UI 线程还是后台线程。

我的插件都有 update 方法中英文切换,这个报错可能会导致右键菜单功能为英文。

修改比较麻烦,需要在新版本 IDEA 编译一个 class,然后用类加载来兼容,一开始官方说必须得弄两个版本分别兼容。

Cool Request 作者有指导怎么修改不过他的新版代码没开源不能直接参考, 好像 apipost 作者也跟着做了,我问问他有没有代码参考。

因为不影响使用,所以一直没动力改哈哈哈,不过倒是影响了下载量。

LinWanCen avatar Jul 25 '24 21:07 LinWanCen

官方已经删除了这个:https://github.com/JetBrains/intellij-community/commit/2e7742737b5bb86d1c9520a1172321f23838ccc0

LinWanCen avatar Aug 28 '24 18:08 LinWanCen

改了吗,低版本怎么兼容啊,

jinsheng8888 avatar Aug 30 '24 03:08 jinsheng8888

我想到了个非常简单的解决方案:继承旧版有的平台自带 Action 即可,待插件市场审核后更新到 2.16.0.2024.09.11_02.50 版本即可。

我继承了这两个类:

com.intellij.ide.actions.CopyAction
com.intellij.ide.actions.CopyReferenceAction

并分享到了官方社区:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/18697727524754-Deprecation-warning-with-ActionUpdateThread?page=1#community_comment_21288290193170

还有官方缺陷平台

https://youtrack.jetbrains.com/issue/IJPL-162047/Resolve-PluginException-ActionUpdateThread.OLDEDT

LinWanCen avatar Sep 10 '24 19:09 LinWanCen