(_message: RPCMessageType, data: RegistrationData<ExecuteCommandRegistrationOptions>)
| 2152 | } |
| 2153 | |
| 2154 | public register(_message: RPCMessageType, data: RegistrationData<ExecuteCommandRegistrationOptions>): void { |
| 2155 | let client = this._client; |
| 2156 | if (data.registerOptions.commands) { |
| 2157 | let disposeables: Disposable[] = []; |
| 2158 | for (const command of data.registerOptions.commands) { |
| 2159 | disposeables.push(Commands.registerCommand(command, (...args: any[]) => { |
| 2160 | let params: ExecuteCommandParams = { |
| 2161 | command, |
| 2162 | arguments: args |
| 2163 | }; |
| 2164 | return client.sendRequest(ExecuteCommandRequest.type, params).then( |
| 2165 | undefined, |
| 2166 | (error) => { |
| 2167 | client.logFailedRequest(ExecuteCommandRequest.type, error); |
| 2168 | } |
| 2169 | ); |
| 2170 | })); |
| 2171 | } |
| 2172 | this._commands.set(data.id, disposeables); |
| 2173 | } |
| 2174 | } |
| 2175 | |
| 2176 | public unregister(id: string): void { |
| 2177 | let disposeables = this._commands.get(id); |
no test coverage detected