google / intellij-gn-plugin

BSD 3-Clause "New" or "Revised" License
13 stars 11 forks source link

Bump minimum IntelliJ version to 2022.3 #38

Closed bc-lee closed 5 months ago

bc-lee commented 6 months ago

While using CLion 2024.2 Beta, I noticed a diagnostic message printed as follows:

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

It appears, in IntelliJ 2022.3, AnAction changed by introducing another base class, ActionUpdateThreadAware. Currently, this is acceptable as it includes a default implementation for getActionUpdateThread that returns ActionUpdateThread.OLD_EDT. However, this implementation is deprecated and will be removed soon.

To ensure compatibility with future IntelliJ versions, we need to update the minimum required version to 2022.3 and implement getActionUpdateThread in NewBuildFileAction to return valid value, not ActionUpdateThread.OLD_EDT.