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

Closed
2 tasks done
stmlange opened this issue Apr 11, 2024 · 16 comments
Closed
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

@kjyv
Copy link

kjyv commented Oct 2, 2024

How hard would a port to Kotlin be, given that there are translation tools and also ChatGPT or similar can probably do a good job?

@leinardi
Copy link
Owner

leinardi commented Oct 2, 2024

@kjyv are you volunteering to do it? 🙂

dw-0 added a commit to dw-0/mypy-pycharm that referenced this issue Oct 3, 2024
fixes leinardi#120

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
@kjyv
Copy link

kjyv commented Oct 3, 2024

I haven't really touched Java in 15 years and have no idea of Kotlin, but I might at some point the more annoyed I get by that error message. If you're adding the fix to the Kotlin version then ;)

@leinardi
Copy link
Owner

leinardi commented Oct 4, 2024

@kjyv Haha, I see where you're coming from! 😄 But if we're going down the Kotlin road, I'd only consider accepting a conversion if the person taking on the job would also take over the maintenance of the project. That means not just converting it, but also handling fixes like the one that's been causing annoyance.

Switching languages is a pretty significant step, and while tools and AI can help, the real challenge comes in maintaining and evolving the project afterward. I'd need someone fully committed to that for the long haul. If you're up for it, though, we can definitely talk! 😉

@dw-0
Copy link
Contributor

dw-0 commented Oct 4, 2024

I don't really want to engage in the "port to Kotlin" discussion here, as it makes no sense at this point imho. Apart from that you don't need to port a full project at once. Kotlin and Java are interoperable. So you could port pieces of the software one by one.

Anyways... i provided a patch for the issue with #122. I have the plugin currently working in IDEA 2024.2.3 and at least those prominent deprecation warnings are gone.

dw-0 added a commit to dw-0/mypy-pycharm that referenced this issue Oct 4, 2024
fixes leinardi#120

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
leinardi added a commit that referenced this issue Oct 5, 2024
Fix #120: Defined action update thread for actions
@fjossandon
Copy link

Thanks @dw-0 and @leinardi for the release! 🎉
@leinardi when do you think this release will be available in the marketplace to update the plugin in PyCharm?? =)
https://plugins.jetbrains.com/plugin/11086-mypy

@leinardi
Copy link
Owner

leinardi commented Oct 7, 2024

@fjossandon I guess in a couple of business days:
image

@fjossandon
Copy link

I see, thanks for the answer. I will be waiting and thanks again.

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

7 participants