Repository navigation
fix: the IDE restarts to install or update LSP4IJ, instead of loading a second version next to the one it unloads - #2391
Merged
lagergren merged 1 commit intoDec 1, 2026
Conversation
… a second version next to the one it unloads Without require-restart, the IDE installed and updated LSP4IJ in a running IDE, and what it kept of the version it unloaded, as a FileViewProviderFactory, met the services of the new version, which failed with a ClassCastException between two class loaders of LSP4IJ. Fixes redhat-developer#2382
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2391 +/- ##
==========================================
+ Coverage 59.80% 59.82% +0.01%
==========================================
Files 859 859
Lines 37602 37602
Branches 7792 7792
==========================================
+ Hits 22488 22495 +7
+ Misses 12031 12024 -7
Partials 3083 3083 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
@coderabbitai review |
Action not completed
|
Collaborator
Author
|
@coderabbitai review |
Action performed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2382.
LSP4IJ 0.30.2, installed in a running IntelliJ 2026.3, failed with:
Cause
Two class loaders of LSP4IJ were alive at once.
plugin.xmldoesn't declarerequire-restart, so the IDE installs or updates LSP4IJ without a restart: it unloads the version it runs and loads the new one.When something of the version it unloads survives, it meets the classes of the new one. In the trace, a
FileViewProviderFactoryis called, and the service container answers with an object whose class comes from the other version's class loader. The surviving part can be an extension that the platform cached, a file view provider, or a reference from a plugin that depends on LSP4IJ.LSP4IJ has a large number of extensions, services and caches, and plugins that depend on it, as Quarkus and Qute do. It can't promise that nothing outlives an unload.
Fix
<idea-plugin require-restart="true">: the IDE restarts to install or update LSP4IJ, so only one version's classes are ever loaded.This is a behaviour change for users: installing or updating LSP4IJ now asks for a restart. Angelo, this is your call: the other way would be to find and release everything that outlives an unload, which I can't reproduce.
Behaviour changes
ClassCastExceptionbetween two of its class loadersTests
PluginRequiresRestartTestfinds LSP4IJ's ownMETA-INF/plugin.xmlamong the plugin descriptors of the class path, by its<id>, and checks that it declaresrequire-restart="true". The bundled plugins have descriptors on the class path too.