-
Notifications
You must be signed in to change notification settings - Fork 31
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
fix: ActionUpdateThread deprecation warnings #122
Conversation
Hi @dw-0, thank you for your contribution and for addressing the ActionUpdateThread deprecation warnings! I appreciate the effort you've put into it. Before I proceed with reviewing the PR, I’d like to kindly ask if you could rebase your branch on top of my old-edt branch. I’ve been working on similar changes there, including fixes for some deprecation warnings, which might overlap with what you’ve tackled. Rebasing will make it easier for me to identify what specifically resolves the issue that I wasn’t able to fix in my branch. |
fixes leinardi#120 Signed-off-by: Dominik Willner <th33xitus@gmail.com>
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
There you go. I built the plugin, installed it from disk, loaded up a python project and did a full project scan. No IDE errors popping up for deprecation in the plugin so far. |
Hey thanks again, I tried your changes and I can confirm that it seems to fix the issue! |
As far as i understand the difference, EDT is the UI thread while BGT is the background thread. I read somewhere that choosing EDT for long running tasks can freeze the UI. So i looked at your descriptions of each action and decided if this is something that should be targeted for the background thread. So i decided to go with BGT for any action that involves scanning, and any action that involves displaying something in a menu or similar should be run on the EDT thread. This is not the actual documentation i read when i made my decision, but at least something you can have a look at if you want: |
Thank you for the explanation and I think that the use of the BGT is actually what is properly fixing the issue because, if you look at my changes carefully, you'll see that I always applied the EDT via the BaseAction, but I was then getting some Final question, do you mind if I add this to the changelog?
|
Ah, yeah that makes sense now! I removed the overwrite from the BaseAction again, because i thought that adding it explicitly in each action makes more sense and a developer has to really think about which action should be handled in which thread. You could of course keep the overwrite in the BaseAction but then you have to overwrite it AGAIN in some actions where you need the other thread. Thats kind of odd.
Sure! Feel free to do so :) |
I would 100% agree with you if the override was for an abstract method but, unfortunately, it is not abstract and it will build totally fine if the developer completely forget to override it and, since the majority of actions are EDT and you still get errors for slow threads on EDT, I would still prefer to add the override to the BaseAction, just to avoid some code duplication. Hope you don't mind. |
Okay i didn't view at it from this perspective, you are right there. I don't mind if you add it back to the BaseAction class then. Its safer, as you explained. |
First time contributor checklist
Contributor checklist
master
branch (and not therelease
branch)using the
Fixes #1234
syntaxDescription
This PR fixes the ActionUpdateThread deprecation warnings appearing in newer IntelliJ IDEA IDEs while using this Plugin.
During build of the project, there are still some other deprecation warnings. Those were not fixed in the scope of this PR.
I decided to target a 2023 PyCharm version, because any 2024 versions would require usage of the
org.jetbrains.intellij.platform
plugin version2.1.0
which would require even more refactorings i was not comfortable with doing them yet. So i decided to bump theorg.jetbrains.intellij
to the latest version1.17.4
.Type of Changes
Related Issue
Closes #120