Skip to content

Add jdt:// URI rewriting for documentation responses#224

Open
tartarughina wants to merge 1 commit intozed-extensions:mainfrom
tartarughina:decompile-docs
Open

Add jdt:// URI rewriting for documentation responses#224
tartarughina wants to merge 1 commit intozed-extensions:mainfrom
tartarughina:decompile-docs

Conversation

@tartarughina
Copy link
Copy Markdown
Collaborator

@tartarughina tartarughina commented Apr 19, 2026

Extends the LSP proxy to resolve jdt:// URIs embedded inside documentation responses, and applies a few performance optimizations along the way.

Problem

Zed cannot open jdt:// URIs. The proxy already rewrites them in textDocument/definition/typeDefinition/implementation responses by fetching the decompiled class via java/classFileContents and exposing it as a temp file. However, JDTLS also embeds jdt:// URIs inside Javadoc markdown (e.g. ArrayList) returned by textDocument/hover, textDocument/signatureHelp, and completionItem/resolve. Those links were unreachable from Zed.

Changes

Feature: rewrite jdt:// URIs in documentation responses

  • Track request IDs for textDocument/hover, textDocument/signatureHelp, and completionItem/resolve on the inbound path.
  • On the matching response, recursively scan all strings in result for embedded jdt:// URIs, resolve each unique one through the existing resolve_jdt_uri cache, and replace the occurrences with the corresponding file:// URI in-place.
  • Deduplication within a response (collect_jdt_uris) and the on-disk cache (path.exists() short-circuit in resolve_jdt_uri) prevent redundant java/classFileContents calls.

Test

  • Run just proxy-install from the extension directory
  • Move the new proxy from .../Zed/extensions/work/java/proxy-bin to the most recent version of the proxy ie. mv java-lsp-proxy v6.8.13.1
  • Restart the language server from Zed

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