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

ActionUpdateThread.OLD_EDT is deprecated and going to be removed soon #120

Open
2 tasks done
stmlange opened this issue Apr 11, 2024 · 8 comments
Open
2 tasks done

Comments

@stmlange
Copy link

Step 1: Are you in the right place?

  • I have verified there are no duplicate active or recent bugs, questions, or requests
  • I have verified that I am using the latest version of the plugin.

Step 2: Describe your environment

PyCharm 2024.1 (Community Edition)
Build #PC-241.14494.241, built on March 28, 2024
Runtime version: 17.0.10+8-b1207.12 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry:
  debugger.new.tool.window.layout=true
  ide.experimental.ui=true
Non-Bundled Plugins:
  com.jetbrains.plugins.ini4idea (241.14494.240)
  some.awesome (1.15)
  com.intellij.ideolog (222.3.2.0)
  com.jetbrains.space (241.14494.150)
  org.sonarlint.idea (10.2.0.77238)
  com.leinardi.pycharm.mypy (0.16.2)
  com.leinardi.pycharm.pylint (0.16.2)

Step 3: Describe the problem:

Steps to reproduce:

  1. Open PyCharm 2024.1 (Community Edition)

Observed Results:

  • Error message:
com.intellij.diagnostic.PluginException: `ActionUpdateThread.OLD_EDT` is deprecated and going to be removed soon. 'com.leinardi.pycharm.mypy.actions.ClearAll' must override `getActionUpdateThread` and chose EDT or BGT. See ActionUpdateThread javadoc. [Plugin: com.leinardi.pycharm.mypy]
	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)

Expected Results:

  • No error message / no usage of deprecated methods
@fjossandon
Copy link

fjossandon commented Aug 18, 2024

Hello, I would like to report that I received the same error about the plugin:

com.intellij.diagnostic.PluginException: `ActionUpdateThread.OLD_EDT` is deprecated and going to be removed soon. 'com.leinardi.pycharm.mypy.actions.ScanCurrentFile' must override `getActionUpdateThread()` and chose EDT or BGT. See ActionUpdateThread javadoc. [Plugin: com.leinardi.pycharm.mypy]
	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)

Hopefully, @leinardi can dedicate some time to fixing it since the plugin is very useful. 🙏
Best regards.

@leinardi
Copy link
Owner

leinardi commented Aug 18, 2024

Hi @fjossandon, I'll try to have a look but I really hope that more contributors will show up to help with the plugin, since I don't really have much time anymore...

EDIT
I haven't tested it yet but I think that something like this should work for this plugin as well: jshiell/checkstyle-idea@086ed5d

@fjossandon
Copy link

Hi @leinardi, unfortunately, I'm only familiar with Python and Perl, I have zero Java knowledge, so I cannot give more help than reporting the issue. I hope it's not too difficult to fix, many thanks for trying.

@bryantruong
Copy link

Yep got the same thing:
com.intellij.diagnostic.PluginException: ActionUpdateThread.OLD_EDT is deprecated and going to be removed soon. 'com.leinardi.pycharm.mypy.actions.ClearAll' must override getActionUpdateThread() and chose EDT or BGT. See ActionUpdateThread javadoc. [Plugin: com.leinardi.pycharm.mypy]
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)

@artel1992
Copy link

Im waiting fix too

@leinardi
Copy link
Owner

leinardi commented Aug 21, 2024

I fixed the com.intellij.diagnostic.PluginException: ActionUpdateThread.OLD_EDT is deprecated and going to be removed soon. but now IDEA is complaining about

java.lang.Throwable: Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc.
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
	at com.intellij.util.SlowOperations.assertSlowOperationsAreAllowed(SlowOperations.java:101)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.ensureIsUpToDate(WorkspaceFileIndexDataImpl.kt:130)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.getFileInfo(WorkspaceFileIndexDataImpl.kt:75)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.getFileInfo(WorkspaceFileIndexImpl.kt:247)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.findFileSetWithCustomData(WorkspaceFileIndexImpl.kt:230)
	at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getModuleForFile(ProjectFileIndexImpl.java:97)
	at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getModuleForFile(ProjectFileIndexImpl.java:90)
	at com.intellij.openapi.module.ModuleUtilCore.lambda$findModuleForFile$0(ModuleUtilCore.java:80)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:909)
	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:65)
	at com.intellij.openapi.module.ModuleUtilCore.findModuleForFile(ModuleUtilCore.java:80)
	at com.leinardi.pycharm.mypy.actions.ScanModule.lambda$update$2(ScanModule.java:87)
	at java.base/java.util.Optional.ifPresentOrElse(Optional.java:196)
	at com.leinardi.pycharm.mypy.actions.ScanModule.update(ScanModule.java:79)

Fixing this requires a big refactoring of the logic that handles the files that should be scanned and, unfortunately, I do not have time for it. I only see 2 options for this: someone else jumps in to help with this refactoring or I just make it official that the plugin is abandoned and reached EOL.

PS
If someone want to check the current fixes, they are available here: https://github.com/leinardi/mypy-pycharm/tree/old-edt

@fjossandon
Copy link

Hello again @leinardi,
I searched for the new error to try to help and found this:
https://www.reddit.com/r/IntelliJIDEA/comments/tqh272/does_anyone_have_a_solution_to_constant/
They mention some way to disable the SlowOperations check, although I'm unsure if that's a solution for the end user or if the plugin can do something about it on its own.

Then I saw in another repo, that people used runAsync to fix the problem:
YiiGuxing/TranslationPlugin#5251
YiiGuxing/TranslationPlugin@ae2c8fe
Not sure if that can be applicable here.

Best regards,

@leinardi
Copy link
Owner

Hi @fjossandon, thank you for taking the time to search for possible solutions. While I was looking for a fix I ended up on the very same results:

  • the first one is a workaround for the end user (just disabling the warning)
  • the second, if I'm not wrong, is not available for Java but only for Kotlin and this plugin is still using Java

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

5 participants