Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix: set java filetype for jdt:// served by textDocumentContent - #311

Closed
asmodeus812 wants to merge 1 commit into
neoclide:masterfrom
asmodeus812:fix/jdt-text-document-content-filetype
Closed

asmodeus812 wants to merge 1 commit into
neoclide:masterfrom
asmodeus812:fix/jdt-text-document-content-filetype

Conversation

@asmodeus812

Copy link
Copy Markdown
Contributor

Fixes #310.

Since jdt.ls 1.61 the server registers workspace/textDocumentContent for the jdt scheme (eclipse-jdtls/eclipse.jdt.ls#3855). coc.nvim's generic content provider then serves jdt:// buffers instead of the coc-java one, and since it doesn't set a filetype, filetype detect maps the trailing .class of the uri to stata.

This keeps the new request and sets the java filetype from the provideTextDocumentContent middleware. The existing java/classFileContents provider is left as it is, as the fallback for servers that don't register the capability.

Tested with coc.nvim release, Neovim 0.12.5 and a minimal Maven project, jumping to java.util.ArrayList:

jdt.ls request used for the jdt:// buffer filetype
1.61.0 workspace/textDocumentContent java
1.60.0 java/classFileContents java

🤖 Generated with Claude Code

jdt.ls 1.61 registers workspace/textDocumentContent for the jdt scheme,
so jdt:// buffers are now served by coc.nvim's generic content provider
instead of ours. That provider does not set the filetype, and filetype
detect maps the trailing .class of the uri to stata. Set the filetype
from the provideTextDocumentContent middleware so the standard request
can be used; the java/classFileContents provider stays as the fallback
for servers that don't register the capability.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@asmodeus812

Copy link
Copy Markdown
Contributor Author

Superseded by #312.

@asmodeus812
asmodeus812 deleted the fix/jdt-text-document-content-filetype branch October 12, 2026 15:17
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.

jdt:// buffers open with filetype=stata since jdt.ls 1.61

1 participant