fehnomenal / intellij-direnv

direnv integration for JetBrains IDEs
MIT License
67 stars 21 forks source link

Update to intellij 2022.3 #32

Closed sh41 closed 1 year ago

sh41 commented 1 year ago
sh41 commented 1 year ago

@fehnomenal

Hope this PR helps. The CI pipeline reports that it ran out of space.

I updated build.gradle.kts because https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html#intellij-platform-based-products-of-recent-ide-versions says:

"When targeting 2022.3+ IDE releases, using Gradle IntelliJ Plugin version 1.10.1 or higher is required."

The easiest thing to do seemed to be to just take the latest copy of the file from the template.

There are some warnings/issues in the CI logs:

https://github.com/fehnomenal/intellij-direnv/actions/runs/3745053031/jobs/6359065710#step:6:9

Task :verifyPluginConfiguration
[gradle-intellij-plugin :verifyPluginConfiguration] The following plugin configuration issues were found:
- The 'since-build' property is lower than the target IntelliJ Platform major version: 202 < 211.
- The Java configuration specifies targetCompatibility=11 but since-build='202' property requires targetCompatibility=1.8.
See: https://jb.gg/intellij-platform-versions

There are also deprecation notices: https://github.com/fehnomenal/intellij-direnv/actions/runs/3745053031/jobs/6359065710#step:6:19

> Task :compileKotlin
w: /home/runner/work/intellij-direnv/intellij-direnv/src/main/kotlin/systems/fehn/intellijdirenv/utils.kt: (16, 43): 'balloonGroup(String): NotificationGroup' is deprecated. Use com.intellij.notification.impl.NotificationGroupEP and com.intellij.notification.NotificationGroupManager

and when I run the pluginVerifier locally I get the following for 2022.3:

Plugin systems.fehn.intellijdirenv:0.2.5 against IC-223.8214.52: Compatible. 2 usages of scheduled for removal API and 1 usage of deprecated API
Deprecated API usages (3): 
    #Deprecated method com.intellij.notification.NotificationGroup.createNotification$default(NotificationGroup, String, String, NotificationType, NotificationListener, int, Object) invocation
        Deprecated method com.intellij.notification.NotificationGroup.createNotification$default(com.intellij.notification.NotificationGroup arg0, java.lang.String arg1, java.lang.String arg2, com.intellij.notification.NotificationType arg3, com.intellij.notification.NotificationListener arg4, int arg5, java.lang.Object arg6) : com.intellij.notification.Notification is invoked in systems.fehn.intellijdirenv.services.DirenvProjectService.importDirenv(VirtualFile) : void
    #Deprecated method com.intellij.notification.NotificationGroup.Companion.balloonGroup(String) invocation
        Deprecated method com.intellij.notification.NotificationGroup.Companion.balloonGroup(java.lang.String displayId) : com.intellij.notification.NotificationGroup is invoked in systems.fehn.intellijdirenv.UtilsKt.<clinit>() : void. This method will be removed in  a future release
    #Deprecated method com.intellij.openapi.project.ProjectManagerListener.projectOpened(Project) is overridden
        Deprecated method com.intellij.openapi.project.ProjectManagerListener.projectOpened(com.intellij.openapi.project.Project project) : void is overridden in class systems.fehn.intellijdirenv.listeners.MyProjectManagerListener. This method will be removed in  a future release
    Plugin can probably be enabled or disabled without IDE restart
sh41 commented 1 year ago

@fehnomenal I've updated other files from the template to keep as much as possible in sync and have resolved the CI warnings that I can. There are still deprecation notices for the code itself, but I think it is beyond the scope of this PR to resolve those. If you would prefer these changes to be separated out into different PRs please let me know.

Also, there is an option to remove the upper bound entirely by setting pluginUntilBuild to nothing in gradle.properties. This would mean that the plugin would say that it works with all new versions without the need for changes to allow it to be installed. The downside is that it may break and cause you support headaches. If that's an option you'd like to explore we can try it out? https://github.com/JetBrains/intellij-platform-plugin-template/issues/325#issuecomment-1347954027

fehnomenal commented 1 year ago

Thank you very much for the PR. I will have a look at your changes. Also nice that you incorporated the recent changes of the template.

I would rather not have the upper bound unrestricted as I get emails about deprecated calls regularly. And indeed is one of them already scheduled for removal.