Send extension host exit code

This commit is contained in:
Alex Dima
2019-03-20 16:53:41 +01:00
parent 2975db6be9
commit 499686ca03
5 changed files with 19 additions and 2 deletions

View File

@@ -121,4 +121,7 @@ export class MainThreadExtensionService implements MainThreadExtensionServiceSha
}
}
$onExtensionHostExit(code: number): void {
this._extensionService._onExtensionHostExit(code);
}
}

View File

@@ -605,6 +605,7 @@ export interface MainThreadExtensionServiceShape extends IDisposable {
$onDidActivateExtension(extensionId: ExtensionIdentifier, startup: boolean, codeLoadingTime: number, activateCallTime: number, activateResolvedTime: number, activationEvent: string | null): void;
$onExtensionActivationError(extensionId: ExtensionIdentifier, error: ExtensionActivationError): Promise<void>;
$onExtensionRuntimeError(extensionId: ExtensionIdentifier, error: SerializedError): void;
$onExtensionHostExit(code: number): void;
}
export interface SCMProviderFeatures {

View File

@@ -640,7 +640,14 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
private _gracefulExit(code: number): void {
// to give the PH process a chance to flush any outstanding console
// messages to the main process, we delay the exit() by some time
setTimeout(() => this._nativeExit(code), 500);
setTimeout(() => {
if (!!this._initData.environment.extensionTestsLocationURI) {
// If extension tests are running, give the exit code to the renderer
this._mainThreadExtensionsProxy.$onExtensionHostExit(code);
return;
}
this._nativeExit(code);
}, 500);
}
private _startExtensionHost(): Promise<void> {