diff --git a/_specifications/specification-3-16.md b/_specifications/specification-3-16.md index 47e8ac700..0e93d4eb9 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,36 @@ _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. + +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.