mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
Use onDynamic*
instead of onScoped*
for events that are returned from method calls (#133445)
This commit is contained in:
parent
cbe175f438
commit
be33a77d8c
|
@ -229,7 +229,7 @@ export function activate(context: vscode.ExtensionContext) {
|
|||
cancellable: false
|
||||
}, (progress) => doResolve(_authority, progress));
|
||||
},
|
||||
tunnelFactory,
|
||||
// tunnelFactory,
|
||||
tunnelFeatures: {
|
||||
elevation: true,
|
||||
public: !!vscode.workspace.getConfiguration('testresolver').get('supportPublicPorts'),
|
||||
|
|
|
@ -1178,8 +1178,8 @@ export namespace ProxyChannel {
|
|||
}
|
||||
|
||||
function propertyIsDynamicEvent(name: string): boolean {
|
||||
// Assume a property is a dynamic event (a method that returns an event) if it has a form of "onScopedSomething"
|
||||
return /^onScoped/.test(name) && strings.isUpperAsciiLetter(name.charCodeAt(8));
|
||||
// Assume a property is a dynamic event (a method that returns an event) if it has a form of "onDynamicSomething"
|
||||
return /^onDynamic/.test(name) && strings.isUpperAsciiLetter(name.charCodeAt(9));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,11 +21,11 @@ export interface IExtensionHostProcessOptions {
|
|||
export interface IExtensionHostStarter {
|
||||
readonly _serviceBrand: undefined;
|
||||
|
||||
onScopedStdout(id: string): Event<string>;
|
||||
onScopedStderr(id: string): Event<string>;
|
||||
onScopedMessage(id: string): Event<any>;
|
||||
onScopedError(id: string): Event<{ error: SerializedError; }>;
|
||||
onScopedExit(id: string): Event<{ code: number; signal: string }>;
|
||||
onDynamicStdout(id: string): Event<string>;
|
||||
onDynamicStderr(id: string): Event<string>;
|
||||
onDynamicMessage(id: string): Event<any>;
|
||||
onDynamicError(id: string): Event<{ error: SerializedError; }>;
|
||||
onDynamicExit(id: string): Event<{ code: number; signal: string }>;
|
||||
|
||||
createExtensionHost(): Promise<{ id: string; }>;
|
||||
start(id: string, opts: IExtensionHostProcessOptions): Promise<{ pid: number; }>;
|
||||
|
|
|
@ -134,23 +134,23 @@ export class ExtensionHostStarter implements IDisposable, IExtensionHostStarter
|
|||
return extHostProcess;
|
||||
}
|
||||
|
||||
onScopedStdout(id: string): Event<string> {
|
||||
onDynamicStdout(id: string): Event<string> {
|
||||
return this._getExtHost(id).onStdout;
|
||||
}
|
||||
|
||||
onScopedStderr(id: string): Event<string> {
|
||||
onDynamicStderr(id: string): Event<string> {
|
||||
return this._getExtHost(id).onStderr;
|
||||
}
|
||||
|
||||
onScopedMessage(id: string): Event<any> {
|
||||
onDynamicMessage(id: string): Event<any> {
|
||||
return this._getExtHost(id).onMessage;
|
||||
}
|
||||
|
||||
onScopedError(id: string): Event<{ error: SerializedError; }> {
|
||||
onDynamicError(id: string): Event<{ error: SerializedError; }> {
|
||||
return this._getExtHost(id).onError;
|
||||
}
|
||||
|
||||
onScopedExit(id: string): Event<{ code: number; signal: string; }> {
|
||||
onDynamicExit(id: string): Event<{ code: number; signal: string; }> {
|
||||
return this._getExtHost(id).onExit;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,23 +67,23 @@ class ExtensionHostProcess {
|
|||
private readonly _id: string;
|
||||
|
||||
public get onStdout(): Event<string> {
|
||||
return this._extensionHostStarter.onScopedStdout(this._id);
|
||||
return this._extensionHostStarter.onDynamicStdout(this._id);
|
||||
}
|
||||
|
||||
public get onStderr(): Event<string> {
|
||||
return this._extensionHostStarter.onScopedStderr(this._id);
|
||||
return this._extensionHostStarter.onDynamicStderr(this._id);
|
||||
}
|
||||
|
||||
public get onMessage(): Event<any> {
|
||||
return this._extensionHostStarter.onScopedMessage(this._id);
|
||||
return this._extensionHostStarter.onDynamicMessage(this._id);
|
||||
}
|
||||
|
||||
public get onError(): Event<{ error: SerializedError; }> {
|
||||
return this._extensionHostStarter.onScopedError(this._id);
|
||||
return this._extensionHostStarter.onDynamicError(this._id);
|
||||
}
|
||||
|
||||
public get onExit(): Event<{ code: number; signal: string }> {
|
||||
return this._extensionHostStarter.onScopedExit(this._id);
|
||||
return this._extensionHostStarter.onDynamicExit(this._id);
|
||||
}
|
||||
|
||||
constructor(
|
||||
|
|
Loading…
Reference in a new issue