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

Incompatible with Idea2024.1 #115

Closed
chaoyoung opened this issue Mar 28, 2024 · 7 comments
Closed

Incompatible with Idea2024.1 #115

chaoyoung opened this issue Mar 28, 2024 · 7 comments

Comments

@chaoyoung
Copy link

com.intellij.diagnostic.PluginException: `ActionUpdateThread.OLD_EDT` is deprecated and going to be removed soon. 'com.github.wangji92.arthas.plugin.action.arthas.ArthasShellScriptCommandAction' must override `getActionUpdateThread` and chose EDT or BGT. See ActionUpdateThread javadoc. [Plugin: com.github.wangji92.arthas.plugin]
	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)
@WangJi92
Copy link
Owner

WangJi92 commented Mar 28, 2024

没有使用这个高的版本,这个影响使用?

https://github.com/carlrobertoh/CodeGPT/issues/400   
https://github.com/bazelbuild/intellij/issues/5993   

我本地 2021的版本都没有这个函数

@chaoyoung
Copy link
Author

没有使用这个高的版本,这个影响使用?

https://github.com/carlrobertoh/CodeGPT/issues/400   
https://github.com/bazelbuild/intellij/issues/5993   

我本地 2021的版本都没有这个函数

经常提示报错,影响啊。就算清除掉,还会提示。

@WangJi92
Copy link
Owner

WangJi92 commented Apr 8, 2024

https://plugins.jetbrains.com/docs/intellij/basic-action-system.html#principal-implementation-overrides

AnAction.getActionUpdateThread() (2022.3+) return an ActionUpdateThread, which specifies if the update() method is called on a background thread (BGT) or the event-dispatching thread (EDT). The preferred method is to run the update on the BGT, which has the advantage of guaranteeing application-wide read access to PSI, the virtual file system (VFS), or project models. Actions that run the update session on the BGT should not access the Swing component hierarchy directly. Conversely, actions that specify to run their update on the EDT must not access PSI, VFS, or project data but have access to Swing components and other UI models. All accessible data is provided by the DataContext as explained in Determining the Action Context. When switching from BGT to EDT is absolutely necessary, actions can use AnActionEvent.getUpdateSession() to access the UpdateSession and then call UpdateSession.compute() to run a function on the EDT. Starting from IntelliJ Platform version 2022.3, the Plugin DevKit will have an inspection in Plugin DevKit | Code | ActionUpdateThread is missing to notify plugin authors about a missing implementation of AnAction.getActionUpdateThread().

这里操作了 virtual-file psi 必须 用 BGT

@WangJi92
Copy link
Owner

WangJi92 commented Apr 9, 2024

java.lang.Throwable: Thread context was already set: [ComponentManager(ProjectImpl@1141896172), CoroutineName(com.github.wangji92.arthas.plugin.action.arthas.ArthasShellScriptCommandAction#actionPerformed@EditorPopup), CoroutineId(13443), "com.github.wangji92.arthas.plugin.action.arthas.ArthasShellScriptCommandAction#actionPerformed@EditorPopup#13443":StandaloneCoroutine{Active}@42f5fdb4, ModalityState.NON_MODAL, ActionContextElement(ArthasShellScriptCommandAction@EditorPopup)]
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
at com.intellij.concurrency.ThreadContext$installThreadContext$1.invoke(threadContext.kt:126)
at com.intellij.concurrency.ThreadContext$installThreadContext$1.invoke(threadContext.kt:124)
at com.intellij.concurrency.ThreadContext.withThreadLocal(threadContext.kt:180)
at com.intellij.concurrency.ThreadContext.installThreadContext(threadContext.kt:124)
at com.intellij.concurrency.ThreadContext.installThreadContext$default(threadContext.kt:123)
at com.intellij.openapi.actionSystem.impl.CapturingListener.run(ActionManagerImpl.kt:1342)
at com.intellij.openapi.actionSystem.impl.ActionManagerImplKt.runListenerAction(ActionManagerImpl.kt:1354)
at com.intellij.openapi.actionSystem.impl.ActionManagerImplKt.access$runListenerAction(ActionManagerImpl.kt:1)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$MyTimer.tick(ActionManagerImpl.kt:1287)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$MyTimer.access$tick(ActionManagerImpl.kt:1230)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$MyTimer$2$1$1.invokeSuspend(ActionManagerImpl.kt:1260)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)

@WangJi92
Copy link
Owner

WangJi92 commented Apr 9, 2024

java.lang.Throwable: Thread context was already set: [ComponentManager(ProjectImpl@1141896172), CoroutineName(com.github.wangji92.arthas.plugin.action.arthas.ArthasShellScriptCommandAction#actionPerformed@EditorPopup), CoroutineId(13443), "com.github.wangji92.arthas.plugin.action.arthas.ArthasShellScriptCommandAction#actionPerformed@EditorPopup#13443":StandaloneCoroutine{Active}@42f5fdb4, ModalityState.NON_MODAL, ActionContextElement(ArthasShellScriptCommandAction@EditorPopup)] at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376) at com.intellij.concurrency.ThreadContext$installThreadContext$1.invoke(threadContext.kt:126) at com.intellij.concurrency.ThreadContext$installThreadContext$1.invoke(threadContext.kt:124) at com.intellij.concurrency.ThreadContext.withThreadLocal(threadContext.kt:180) at com.intellij.concurrency.ThreadContext.installThreadContext(threadContext.kt:124) at com.intellij.concurrency.ThreadContext.installThreadContext$default(threadContext.kt:123) at com.intellij.openapi.actionSystem.impl.CapturingListener.run(ActionManagerImpl.kt:1342) at com.intellij.openapi.actionSystem.impl.ActionManagerImplKt.runListenerAction(ActionManagerImpl.kt:1354) at com.intellij.openapi.actionSystem.impl.ActionManagerImplKt.access$runListenerAction(ActionManagerImpl.kt:1) at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$MyTimer.tick(ActionManagerImpl.kt:1287) at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$MyTimer.access$tick(ActionManagerImpl.kt:1230) at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$MyTimer$2$1$1.invokeSuspend(ActionManagerImpl.kt:1260) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)

 SwingUtilities.invokeLater(() ->{
            ArthasShellScriptCommandDialog dialog = new ArthasShellScriptCommandDialog(event);
            dialog.open("Quickly Get Available Command(shell command or common command)");
        }); 

@WangJi92
Copy link
Owner

#118

@WangJi92
Copy link
Owner

@chaoyoung 升级一下版本 ,2.45 已经支持

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

No branches or pull requests

2 participants