MCPcopy Index your code
hub / github.com/microsoft/vscode-languageserver-node / register

Method register

client/src/client.ts:2154–2174  ·  view source on GitHub ↗
(_message: RPCMessageType, data: RegistrationData<ExecuteCommandRegistrationOptions>)

Source from the content-addressed store, hash-verified

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);

Callers 1

initializeMethod · 0.95

Calls 2

setMethod · 0.80
sendRequestMethod · 0.65

Tested by

no test coverage detected