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

Method registerSingle1

server/src/main.ts:742–758  ·  view source on GitHub ↗
(unregistration: BulkUnregistrationImpl, type: string | RPCMessageType, registerOptions: any)

Source from the content-addressed store, hash-verified

740 }
741
742 private registerSingle1(unregistration: BulkUnregistrationImpl, type: string | RPCMessageType, registerOptions: any): Thenable<Disposable> {
743 const method = Is.string(type) ? type : type.method;
744 const id = UUID.generateUuid();
745 let params: RegistrationParams = {
746 registrations: [{ id, method, registerOptions: registerOptions || {} }]
747 }
748 if (!unregistration.isAttached) {
749 unregistration.attach(this._connection);
750 }
751 return this._connection.sendRequest(RegistrationRequest.type, params).then((_result) => {
752 unregistration.add({ id: id, method: method });
753 return unregistration;
754 }, (_error) => {
755 this.connection.console.info(`Registering request handler for ${method} failed.`);
756 return Promise.reject(_error);
757 });
758 }
759
760 private registerSingle2(type: string | RPCMessageType, registerOptions: any): Thenable<Disposable> {
761 const method = Is.string(type) ? type : type.method;

Callers 1

registerMethod · 0.95

Calls 4

attachMethod · 0.65
sendRequestMethod · 0.65
addMethod · 0.65
infoMethod · 0.65

Tested by

no test coverage detected