Skip to content

Conversation

@gnuemacscoin
Copy link

I've been looking around to see what's missing to get eglot to behave more like lsp-mode when visiting files generated from java/classFileContents.

eclipse-jdtls/eclipse.jdt.ls#3423

eclipse-jdtls/eclipse.jdt.ls#2322 (comment)

It turns out that all that's necessary to get proper diagnostics is to refer to a generated file by its original jdt:// URI in all subsequent communications. We already store the URI in a companion .metadata file, all that's missing is to read it out whenever eglot asks for the file's URI. lsp-java does this by setting lsp-buffer-uri.

https://github.com/emacs-lsp/lsp-java/blob/9230a0007c79a661028c142f35c7b8d1f9f55453/lsp-java.el#L1451

Change the URI used to refer to a JDT provided file to the one that
was used to generate it in the first place.
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