Skip to content

fix: support IntelliJ IDEA 2026.2 - #1634

Open
sxlijin wants to merge 3 commits into
redhat-developer:mainfrom
sxlijin:agent/fix-2026-2-structure-view-dependency
Open

fix: support IntelliJ IDEA 2026.2#1634
sxlijin wants to merge 3 commits into
redhat-developer:mainfrom
sxlijin:agent/fix-2026-2-structure-view-dependency

Conversation

@sxlijin

@sxlijin sxlijin commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #1633.

What changed

  • Declare an optional dependency on the bundled intellij.structureView.plugin and add its required optional configuration descriptor.
  • Remove the Plugin Verifier upper build bound so stable releases after 261.*, including 2026.2, are covered.
  • Omit the coarse MISSING_DEPENDENCIES failure level because Plugin Verifier also applies it to unavailable optional dependencies (MP-2974); invalid plugins and compatibility problems remain fatal.

Root cause

PsiTreeElementBase and StructureViewWrapperImpl still exist in IntelliJ IDEA 2026.2.1. Their class files moved from the IDE core classpath in 2026.1 to plugins/platform-structureView-plugin/lib/modules/intellij.platform.structureView.jar in 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.plugin as the owning plugin and expose its intellij.platform.structureView module publicly.

Before and after

I built upstream main at d1a91b422cf8f72a73ddbdda0ea3a6ae32caead5 with ./gradlew clean buildPlugin and checked the resulting lsp4ij-0.20.2-SNAPSHOT.zip using JetBrains Plugin Verifier 1.408 against the exact IntelliJ IDEA Ultimate 2026.2.1 build IU-262.9437.185.

Before:

IU-262.9437.185 against com.redhat.devtools.lsp4ij:0.20.2-SNAPSHOT: 2 compatibility problems.
Package 'com.intellij.ide.structureView.impl.common' is not found along with its class com.intellij.ide.structureView.impl.common.PsiTreeElementBase.
Method StructureViewEditorFeature.lambda$collectUiRunnable$0() references an unresolved class com.intellij.ide.impl.StructureViewWrapperImpl.

After changing only the plugin dependency metadata and verifier range:

IU-262.9437.185 against com.redhat.devtools.lsp4ij:0.20.2-SNAPSHOT: Compatible.

The 2026.1.5 control remains compatible:

IU-261.27258.48 against com.redhat.devtools.lsp4ij:0.20.2-SNAPSHOT: Compatible.
intellij.structureView.plugin (optional): Dependency is not resolved.

Validation

  • ./gradlew clean buildPlugin — passed.
  • ./gradlew verifyPluginStructure verifyPluginProjectConfiguration — passed; the project configuration task retains its existing Java 17 versus platform 2024.2 warning.
  • Plugin Verifier 1.408 against IU-262.9437.185 — compatible.
  • Plugin Verifier 1.408 against 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.

@sxlijin sxlijin changed the title Fix IntelliJ IDEA 2026.2 Structure View compatibility fix: support Structure View classes in IntelliJ IDEA 2026.2 Aug 15, 2026
@sxlijin sxlijin changed the title fix: support Structure View classes in IntelliJ IDEA 2026.2 fix: support IntelliJ IDEA 2026.2 Aug 15, 2026
@angelozerr

Copy link
Copy Markdown
Contributor

Thanks so much @sxlijin for working on this issue!

Please tell me when you will think it will be ready.

@sxlijin
sxlijin marked this pull request as ready for review August 17, 2026 19:11
@sxlijin

sxlijin commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

Whoops, forgot to move it out of draft.

Comment thread build.gradle.kts

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bug from JetBrains right? Is it required to do that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sxlijin please tell me if we can keep MISSING_DEPENDENCIES

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even with optional="true" ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LSP4IJ 0.20.1 does not work with IntelliJ IDEA 2026.2.1

2 participants