fix: support IntelliJ IDEA 2026.2 - #1634
Conversation
|
Thanks so much @sxlijin for working on this issue! Please tell me when you will think it will be ready. |
|
Whoops, forgot to move it out of draft. |
|
|
||
| pluginVerification { | ||
| failureLevel = listOf(INVALID_PLUGIN, COMPATIBILITY_PROBLEMS, MISSING_DEPENDENCIES) | ||
| // MISSING_DEPENDENCIES also fails for unavailable optional dependencies; see https://youtrack.jetbrains.com/issue/MP-2974. |
There was a problem hiding this comment.
It is a bug from JetBrains right? Is it required to do that?
There was a problem hiding this comment.
@sxlijin please tell me if we can keep MISSING_DEPENDENCIES
There was a problem hiding this comment.
intellij.structureView.plugin is introduced in 262, it looks like, so it doesn't exist in 261.* or earlier, and that raises a MISSING_DEPENDENCIES error on 261
therefore the options were either:
- retain MISSING_DEPENDENCIES and ship a different version of lsp4ij starting in 262, or
- drop MISSING_DEPENDENCIES
There was a problem hiding this comment.
even with optional="true" ?
There was a problem hiding this comment.
We had a similare issue with spellchecker, we did that:
if (ideaVersionInt >= 252) {
// Since 2025.2, JetBrains moved spellchecker in a new "intellij.spellchecker" module
bundledModule("intellij.spellchecker")
}
Could you please try to follow this idea.
Fixes #1633.
What changed
intellij.structureView.pluginand add its required optional configuration descriptor.261.*, including 2026.2, are covered.MISSING_DEPENDENCIESfailure level because Plugin Verifier also applies it to unavailable optional dependencies (MP-2974); invalid plugins and compatibility problems remain fatal.Root cause
PsiTreeElementBaseandStructureViewWrapperImplstill exist in IntelliJ IDEA 2026.2.1. Their class files moved from the IDE core classpath in 2026.1 toplugins/platform-structureView-plugin/lib/modules/intellij.platform.structureView.jarin 2026.2. Because LSP4IJ did not declare the owning bundled plugin, those classes were outside LSP4IJ's dependency-visible classpath. The dependency is optional so the same plugin archive remains compatible with 2026.1, where that bundled plugin ID is absent and the classes are still supplied by the core classpath.The 262.9437 source and product descriptors identify
intellij.structureView.pluginas the owning plugin and expose itsintellij.platform.structureViewmodule publicly.Before and after
I built upstream
mainatd1a91b422cf8f72a73ddbdda0ea3a6ae32caead5with./gradlew clean buildPluginand checked the resultinglsp4ij-0.20.2-SNAPSHOT.zipusing JetBrains Plugin Verifier 1.408 against the exact IntelliJ IDEA Ultimate 2026.2.1 buildIU-262.9437.185.Before:
After changing only the plugin dependency metadata and verifier range:
The 2026.1.5 control remains compatible:
Validation
./gradlew clean buildPlugin— passed../gradlew verifyPluginStructure verifyPluginProjectConfiguration— passed; the project configuration task retains its existing Java 17 versus platform 2024.2 warning.IU-262.9437.185— compatible.IU-261.27258.48— compatible, with the expected missing optional dependency note../gradlew test— 441 tests executed, with 7 unrelated failures where the IntelliJ test harness rejected macOS temporary files as outside its allowed VFS roots; 3 tests were skipped.