From a2cea3e80c855b3432bf5186e2c0dfac93831a2e Mon Sep 17 00:00:00 2001 From: Kris De Volder Date: Thu, 29 Oct 2020 14:00:27 -0700 Subject: [PATCH 1/2] client/executeCommand See: https://github.com/microsoft/language-server-protocol/issues/1117 --- _specifications/specification-3-16.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/_specifications/specification-3-16.md b/_specifications/specification-3-16.md index 47e8ac700..0f0fbec4d 100644 --- a/_specifications/specification-3-16.md +++ b/_specifications/specification-3-16.md @@ -2715,7 +2715,7 @@ _Response_: * partial result: `SymbolInformation[]` as defined above. * error: code and message set in case an exception happens during the workspace symbol request. -#### Execute a command (:leftwards_arrow_with_hook:) +#### Execute a server command (:leftwards_arrow_with_hook:) The `workspace/executeCommand` request is sent from the client to the server to trigger command execution on the server. In most cases the server creates a `WorkspaceEdit` structure and applies the changes to the workspace using the request `workspace/applyEdit` which is sent from the server to the client. @@ -2779,6 +2779,31 @@ _Response_: * result: `any` \| `null` * error: code and message set in case an exception happens during the request. +#### Execute a client command(:leftwards_arrow_with_hook:) + +The `client/executeCommand` request is similar to `workspace/executeCommand` but is sent from the server to the client, to trigger command execution on the client. + +_Client Capability_: +* property path (optional): `client.executeCommand` +* property type: `ClientExecuteCommandClientCapabilities` defined as follows: + +```typescript +export interface ClientExecuteCommandClientCapabilities { + /** + * The client supports message 'client/executeCommand'. + */ + supported: boolean; +} +``` + +_Request:_ +* method: 'client/executeCommand' +* params: `ExecuteCommandParams` defined exactly the same way as for 'workspace/executeCommand'. + +_Response_: +* result: `any` \| `null` +* error: code and message set in case an exception happens during the request. + #### Applies a WorkspaceEdit (:arrow_right_hook:) The `workspace/applyEdit` request is sent from the server to the client to modify resource on the client side. From baa4d4f7286941557825d5f7b269292722f91809 Mon Sep 17 00:00:00 2001 From: Kris De Volder Date: Thu, 29 Oct 2020 14:49:36 -0700 Subject: [PATCH 2/2] Be more specific about error response --- _specifications/specification-3-16.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_specifications/specification-3-16.md b/_specifications/specification-3-16.md index 0f0fbec4d..0e93d4eb9 100644 --- a/_specifications/specification-3-16.md +++ b/_specifications/specification-3-16.md @@ -2804,6 +2804,11 @@ _Response_: * result: `any` \| `null` * error: code and message set in case an exception happens during the request. +The client shall return `ErrorCode.InvalidParams` when the server requests + +- a command that doesn't exist +- invalid params for the command signature + #### Applies a WorkspaceEdit (:arrow_right_hook:) The `workspace/applyEdit` request is sent from the server to the client to modify resource on the client side.