Repository navigation
fix: set java filetype for jdt:// served by textDocumentContent - #311
Closed
asmodeus812 wants to merge 1 commit into
Closed
asmodeus812 wants to merge 1 commit into
asmodeus812 wants to merge 1 commit into
Conversation
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>
Contributor
Author
|
Superseded by #312. |
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 #310.
Since jdt.ls 1.61 the server registers
workspace/textDocumentContentfor thejdtscheme (eclipse-jdtls/eclipse.jdt.ls#3855). coc.nvim's generic content provider then servesjdt://buffers instead of the coc-java one, and since it doesn't set a filetype,filetype detectmaps the trailing.classof the uri tostata.This keeps the new request and sets the
javafiletype from theprovideTextDocumentContentmiddleware. The existingjava/classFileContentsprovider 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 tojava.util.ArrayList:workspace/textDocumentContentjava/classFileContents🤖 Generated with Claude Code