Upgrade to use new IJ ActionUpdateThread API#875
Conversation
| import com.intellij.openapi.actionSystem.KeyboardShortcut | ||
| import com.intellij.openapi.actionSystem.ShortcutSet | ||
| import com.intellij.openapi.project.DumbAwareAction | ||
| import com.intellij.openapi.actionSystem.* |
There was a problem hiding this comment.
I assume your IntelliJ settings changed it. I do not like wildcard imports (StackOverflow)
| class ReportCodyBugAction : DumbAwareAction("Open GitHub To Report Cody Issue") { | ||
| class ReportCodyBugAction : DumbAwareBGTAction("Open GitHub To Report Cody Issue") { | ||
| override fun actionPerformed(p0: AnActionEvent) { | ||
| BrowserUtil.open("https://github.com/sourcegraph/jetbrains/issues/new?template=bug_report.yml") |
There was a problem hiding this comment.
where is it used? this action? don't we need to put the label param btw?
There was a problem hiding this comment.
In the CodyStatusBarActionGroup.
What label param?
| } | ||
|
|
||
| @Suppress("MissingRecentApi") | ||
| override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT |
There was a problem hiding this comment.
IIUC this is the other case (next to DumbAwareAction) where we need to define getActionUpdateThread, right?
- can we have a similar solution -
NotificationBGTAction? - can you add a CI check that verifies that we DO not use
NotificationActionorDumbAwareActionin any other place than the corresponding abstract classes?
There was a problem hiding this comment.
Turns out for NotificationAction it is not really needed, I will revert this.
In fact it looks it is needed only on classes which overrides update method, so I will do a few more reverts.
There was a problem hiding this comment.
As for CI it's possible to run IJ inspection but I do not see an easy way to verify this in CI.
2674f14 to
2e55b24
Compare
Changes
Fixes #610
ActionUpdateThread.OLD_EDT is deprecated and going to be removed soonWhy we get that issue?
https://plugins.jetbrains.com/docs/intellij/basic-action-system.html#principal-implementation-overrides
https://github.com/JetBrains/intellij-community/blob/idea/233.14475.28/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/ActionUpdateThread.java
New API was become required in 2024 EAP, and every IntelliJ
Actionmust define ifupdateshould be running onEDTorBGTthread. Unfortunately that API was not present before2022.2, so we need to upgrade a bit.Test plan
This change requires full manual QA