You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No language features in a document opened from workspace/textDocumentContent #2026
LSP4IJ 0.30.0 opens a document that a language server provides with workspace/textDocumentContent (#1749) as a read-only DocumentContentFile and connects it to the server: the server gets didOpen and pulls its diagnostics. No other feature works in it, though: Go to Definition, hover, highlighting, folding, semantic tokens, inlay hints and code lenses send no request.
LanguageServersRegistry.isFileSupported returns false for a LightVirtualFile outside the local file system (since #782), and a DocumentContentFile is a LightVirtualFile. LSPGotoDeclarationHandler and the other features check isFileSupported before they ask the server, so they return nothing.
Once the check passes for a DocumentContentFile, hover fails: MarkdownConverter.getHtmlRenderer takes the parent of the file as the base directory of relative links, and a DocumentContentFile has no parent:
java.lang.NullPointerException: Cannot invoke "com.intellij.openapi.vfs.VirtualFile.getFileSystem()" because the return value of "com.intellij.openapi.vfs.VirtualFile.getParent()" is null
at com.redhat.devtools.lsp4ij.features.documentation.MarkdownConverter.getHtmlRenderer(MarkdownConverter.java:132)
To reproduce
The language server of xtclang/xvm serves the sources of its bundled libraries as ecstasy-library: documents. Go to Definition on a library type opens its source; Go to Definition on a call in that source then does nothing in IntelliJ, though the server answers textDocument/definition for it when asked directly.
In LSP4IJ's own tests: in DocumentContentNavigationTest, open the server's document in an editor and call new LSPGotoDeclarationHandler().getGotoDeclarationTargets(element, offset, editor) in it. It returns no target, and the mock server gets no textDocument/definition.
Activity
fix: give a document opened from workspace/textDocumentContent the fe…