redhat-developer / redhat-developer/lsp4ij
End user-facing error reported when opening a project with restored LSP4IJ editor tabs
@angelozerr is already working on this.
Since Jan 10, 2025.
- Dominant language
- Java
- Stars
- 344
- Forks
- 113
- Avg merge
- 5h 22m
- Merged PRs (30d)
- 15
Description
I sometimes see this error when opening a project that was closed with active editor tabs associated with an LSP4IJ language server definition:
Error while consuming 'textDocument/foldingRange' with language server 'TypeScript Language Server'
org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Request textDocument/foldingRange failed with message: The document should be opened for foldingRanges', file: file:///C:/Users/Scott/dev/projects/IlluminatedCloudTestProjects/df17-with-manifest/force-app/main/default/lwc/demoComponent/demoComponent.js
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
at com.redhat.devtools.lsp4ij.LanguageServerWrapper.lambda$start$4(LanguageServerWrapper.java:314)
@angelozerr provided the following thoughts:
This error comes from when textDocument/foldingRange is called BEFORE a didOpen
When IJ is opening, it opens JavaScript file and as your IJ is indexing, the language server is not started
I did that to improve drasticly the performance of startup
when indexing is finished, I refresh folding
but I think that I have missed the didOpen part in some cases
Overall the error sems to be benign, but it is a bit jarring when opening the project.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.