Skip to content

[LS] Cannot use CreateFile, RenameFile, and DeleteFile inside a WorkspaceEdit #4723

Closed
@kittaakos

Description

Spec: https://microsoft.github.io/language-server-protocol/specification#version_3_13_0

Currently, we use vscode-base-languageclient@4.4.0 in Theia which has the following logic to handle workspace/applyEdit:

if (change.textDocument.version && change.textDocument.version >= 0) {

Link: https://github.com/Microsoft/vscode-languageserver-node/blob/5f9c993ff38f5c369949aeb359b3e9b178172dbc/client/src/client.ts#L3019

VS. the 5.1.0 version:

if (TextDocumentEdit.is(change) && change.textDocument.version && change.textDocument.version >= 0) {

Link: https://github.com/Microsoft/vscode-languageserver-node/blob/71fc1da3fed87329080f9c2a2c32e5e07aed3128/client/src/client.ts#L3167

The older version of the language client does not support these new documentChanges and will result in an error on the server side:

org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Request workspace/applyEdit failed with message: Cannot read property 'version' of undefined
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)

Metadata

Assignees

No one assigned

    Labels

    bugbugs found in the applicationlsplanguage server protocolmonacoissues related to monaco

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions