Repository navigation
fix: compile against IntelliJ 2025.3 - #1906
Merged
angelozerr merged 2 commits intoNov 9, 2026
Merged
angelozerr merged 2 commits into
angelozerr merged 2 commits into
Conversation
2025.3 changed two methods that LSP4IJ overrides, MoveFileHandler.retargetUsages and RefactoringHelper.prepareOperation, from List<UsageInfo> and List<PsiElement> to List<? extends UsageInfo> and List<? extends PsiElement>. Both erase to the same List, so the plugin built against 2024.2 still runs on 2025.3, as the plugin verification shows, but javac refuses either generic signature against the other platform. The two overrides now take raw types, which override both, with a comment saying why and when they can go. LSPInlineCompletionProviderContextTest creates an InlineCompletionEvent.LookupChange, whose constructor takes the editor too since 2025.3; it now calls the one that the platform has. FileOperationRefactoringTest runs its moves under a progress indicator, as the IDE does, since the platform's move of files takes the indicator of the thread since 2025.3. The main code and the tests compile against 2024.2 and 2025.3, and the affected tests pass on both. Fixes redhat-developer#1903.
The move helper of FileOperationRefactoringTest now takes the destination first and the moved elements as varargs, and no longer sits between the Javadoc of answerWillRenameSlowlyWithAnEditTo and that method.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1906 +/- ##
=======================================
Coverage 47.97% 47.97%
=======================================
Files 808 808
Lines 32269 32270 +1
Branches 4961 4962 +1
=======================================
+ Hits 15480 15483 +3
+ Misses 14299 14294 -5
- Partials 2490 2493 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
@coderabbitai full review |
Action performed
|
Contributor
|
LGTM, thanks @lagergren ! |
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 #1903.
LSP4IJ didn't compile against IntelliJ 2025.3. Users weren't affected: the plugin is built against 2024.2, and the plugin verification finds it compatible with every IDE from 2024.2 to 2026.3, since the changes below keep the erased signatures. It mattered for building against a newer platform, as when
platformVersionmoves.WillRenameFilesMoveHandler.retargetUsagesandWillRenameFilesRefactoringHelper.prepareOperation. 2025.3 declaresList<? extends UsageInfo>andList<? extends PsiElement>where 2024.2 declaresList<UsageInfo>andList<PsiElement>. Overriding with either generic type doesn't compile against the other platform ("name clash: … have the same erasure, yet neither overrides the other"), but both erase toList, and a method declared with the erased types overrides both. The two overrides now take raw types, with a comment saying why, and that the generic types can come back once the oldest supported platform is 2025.3.prepareOperationonly reads its elements.LSPInlineCompletionProviderContextTestcreates anInlineCompletionEvent.LookupChange, whose constructor is(LookupEvent)up to 2025.2 and(Editor, LookupEvent)since 2025.3. The test now calls the one that the platform has.FileOperationRefactoringTestruns its moves under a progress indicator, as the IDE does: since 2025.3, the platform's move of files (MoveFilesOrDirectoriesUtil.moveElements) takes the indicator of the thread, and a test that ran the processor directly failed with aNullPointerExceptionthere.Tested with
-PplatformVersion=2024.2and-PplatformVersion=2025.3: the main code and all tests compile, andFileOperationRefactoringTest,FileRenameUriTest,FileOperationEditSaveTestand the inline completion tests pass on both (16 tests, 3 skipped).Not changed here: Gradle warns that IntelliJ IDEA Community (
platformType=IC) isn't published after 2025.3, so building against a later platform needs a change of the platform type too, and the "Latest IJ" workflow, which builds against the latest platform each night, is disabled.