Skip to content

chore: delete the catch blocks kept for IntelliJ versions before 2024.2 - #2039

Merged
lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:chore/delete-the-blocks-for-before-2024-2
Nov 21, 2026
Merged

lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:chore/delete-the-blocks-for-before-2024-2

Conversation

@lagergren

Copy link
Copy Markdown
Collaborator

LSPServerSideOnTypeFormattingHelper and ServerInstallerBase caught
ProcessCanceledException before CancellationException, with the same
code in both blocks, and a TODO to delete the first block once LSP4IJ
needs IntelliJ 2024.2, where ProcessCanceledException extends
CancellationException. LSP4IJ needs 2024.2 (pluginSinceBuild=242),
so the CancellationException block now catches both, as before.

CompletableFutures keeps its two blocks: there, a
ProcessCanceledException is rethrown and a CancellationException is
not.

Test: the tests of on-type formatting and of the server installers pass
(139 tests).

`LSPServerSideOnTypeFormattingHelper` and `ServerInstallerBase` caught
`ProcessCanceledException` before `CancellationException`, with the same
code in both blocks, and a TODO to delete the first block once LSP4IJ
needs IntelliJ 2024.2, where `ProcessCanceledException` extends
`CancellationException`. LSP4IJ needs 2024.2 (`pluginSinceBuild=242`),
so the `CancellationException` block now catches both, as before.

`CompletableFutures` keeps its two blocks: there, a
`ProcessCanceledException` is rethrown and a `CancellationException` is
not.

Test: the tests of on-type formatting and of the server installers pass
(139 tests).
@lagergren lagergren added this to the 0.30.2 milestone Nov 20, 2026
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Refactor
    • Consolidated cancellation handling for formatting and server installation. Installation failures unrelated to cancellation continue to be reported as errors.

The formatting helper and installer remove dedicated ProcessCanceledException catches. Their existing CancellationException handlers handle cancellation.

Changes: Cancellation Handling

Layer / File(s) Summary
Use existing cancellation handlers
src/main/java/com/redhat/devtools/lsp4ij/features/formatting/LSPServerSideOnTypeFormattingHelper.java, src/main/java/com/redhat/devtools/lsp4ij/installation/ServerInstallerBase.java
Both classes remove the ProcessCanceledException import and dedicated catch. The formatting handler cancels formatting support and returns false; the installer handler cancels the installation future.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Refactor

Suggested reviewers: angelozerr, scwells72

Merge Risk: Minimal · up to 69cbe

This change removes redundant cancellation catch blocks. Cancellation is still handled by the existing CancellationException handlers, so behavior is expected to stay the same on the minimum supported IntelliJ version, 2024.2. No actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change accurately: the PR deletes the catch blocks that were kept for IntelliJ versions before 2024.2. The summary and objectives confirm that the ProcessCanceledException catches …
Description check Passed The description matches the changeset. It explains that the ProcessCanceledException catch blocks in LSPServerSideOnTypeFormattingHelper and ServerInstallerBase are removed because LSP4IJ now requires…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change accurately: the PR deletes the catch blocks that were kept for IntelliJ versions before 2024.2. The summary and objectives confirm that the ProcessCanceledException catches in LSPServerSideOnTypeFormattingHelper and ServerInstallerBase are removed. The title is a single concise sentence, and the chore: prefix is a conventional commit type. It is specific enough for a teammate to understand the primary change.

Full details: Description check

Explanation

The description matches the changeset. It explains that the ProcessCanceledException catch blocks in LSPServerSideOnTypeFormattingHelper and ServerInstallerBase are removed because LSP4IJ now requires IntelliJ 2024.2, where ProcessCanceledException extends CancellationException. It also states that CompletableFutures keeps its separate blocks and reports the test results.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fe4d34d0-4807-47a6-b509-83e2be4d8cb4
Commits

Reviewing files that changed from the base of the PR and between 13916a2 and 69cbec8.

Files selected for processing: 2

  • src/main/java/com/redhat/devtools/lsp4ij/features/formatting/LSPServerSideOnTypeFormattingHelper.java
  • src/main/java/com/redhat/devtools/lsp4ij/installation/ServerInstallerBase.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@codecov

codecov Bot commented Nov 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.42%. Comparing base (13916a2) to head (69cbec8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2039      +/-   ##
==========================================
- Coverage   49.43%   49.42%   -0.01%     
==========================================
  Files         813      813              
  Lines       33324    33319       -5     
  Branches     6848     5191    -1657     
==========================================
- Hits        16473    16468       -5     
  Misses      14278    14278              
  Partials     2573     2573              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lagergren

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lagergren

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lagergren
lagergren merged commit 221e8bf into redhat-developer:main Nov 21, 2026
9 checks passed
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.

1 participant