Skip to content

Handle JDTLS internal errors in proxy#277

Open
imedfan wants to merge 1 commit into
zed-extensions:mainfrom
imedfan:fix/jdtls-internal-error-fallback
Open

Handle JDTLS internal errors in proxy#277
imedfan wants to merge 1 commit into
zed-extensions:mainfrom
imedfan:fix/jdtls-internal-error-fallback

Conversation

@imedfan

@imedfan imedfan commented Jul 7, 2026

Copy link
Copy Markdown

JDTLS can return JSON-RPC Internal error responses for user-facing editor requests. In practice that can make completions, code actions, and navigation feel broken even when the language server process is still alive. It can also return signatureHelp.activeParameter = -1, which is invalid for clients expecting an unsigned integer.

This change makes java-lsp-proxy more defensive:

  • Tracks editor requests that need URI rewriting or safe fallback handling.
  • Converts JDTLS internal errors into safe LSP results for the affected request type.
  • Returns the original completion item for failed completionItem/resolve requests.
  • Returns [] for failed codeAction, codeLens, and documentHighlight requests.
  • Returns null for failed definition, hover, and signature help requests.
  • Removes negative activeParameter from successful signature help responses.
  • Adds proxy unit tests for internal-error detection, fallback responses, and signature-help sanitizing.

This is intended to improve resilience around failures similar to #226, #68, and #62 without changing managed JDTLS settings or project import defaults.

Validation:

  • cargo fmt --all
  • cargo check --workspace
  • cargo test --workspace
  • cargo build --release --target wasm32-wasip1
  • cargo build --release -p java-lsp-proxy --target aarch64-apple-darwin

@cla-bot

cla-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Палкин Артем.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@imedfan imedfan force-pushed the fix/jdtls-internal-error-fallback branch from b9b50a9 to 9a7d2c9 Compare July 7, 2026 12:48
@cla-bot

cla-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @imedfan on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@imedfan

imedfan commented Jul 7, 2026

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot

cla-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @imedfan on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@cla-bot

cla-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@imedfan

imedfan commented Jul 7, 2026

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Jul 7, 2026
@cla-bot

cla-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@imedfan imedfan marked this pull request as ready for review July 7, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant