Let IRPCProtocol#getProxy return Proxied<T> which enforces functions returning promises

fyi @sandy081 had to remove the overload of `MainThreadOutputServiceShape#$update` because I couldn't get this to work with mapped types

fyi @Tyriar this fixed an actual issue with terminals
This commit is contained in:
Johannes Rieken
2022-01-17 18:10:06 +01:00
parent 4aed6e1fd1
commit 393443eb40
8 changed files with 23 additions and 19 deletions

View File

@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ProxyIdentifier, IRPCProtocol } from 'vs/workbench/services/extensions/common/proxyIdentifier';
import { ProxyIdentifier, IRPCProtocol, Proxied } from 'vs/workbench/services/extensions/common/proxyIdentifier';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
export const IExtHostRpcService = createDecorator<IExtHostRpcService>('IExtHostRpcService');
@@ -15,7 +15,7 @@ export interface IExtHostRpcService extends IRPCProtocol {
export class ExtHostRpcService implements IExtHostRpcService {
readonly _serviceBrand: undefined;
readonly getProxy: <T>(identifier: ProxyIdentifier<T>) => T;
readonly getProxy: <T>(identifier: ProxyIdentifier<T>) => Proxied<T>;
readonly set: <T, R extends T> (identifier: ProxyIdentifier<T>, instance: R) => R;
readonly assertRegistered: (identifiers: ProxyIdentifier<any>[]) => void;
readonly drain: () => Promise<void>;