(unregistration: BulkUnregistrationImpl, type: string | RPCMessageType, registerOptions: any)
| 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; |
no test coverage detected