Skip to content

End user-facing error reported when opening a project with restored LSP4IJ editor tabs #733

Open
@SCWells72

Description

@SCWells72

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions