提交 6b816701 编写于 作者: D Daniel Imms

Handle ext host exit when debugging

Fixes #70984
上级 fcb773d1
......@@ -641,11 +641,12 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
// 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(() => {
if (!!this._initData.environment.extensionTestsLocationURI) {
// If extension tests are running, give the exit code to the renderer
// If extension tests are running, give the exit code to the renderer
if (this._initData.remoteAuthority && !!this._initData.environment.extensionTestsLocationURI) {
this._mainThreadExtensionsProxy.$onExtensionHostExit(code);
return;
}
this._nativeExit(code);
}, 500);
}
......
......@@ -34,6 +34,7 @@ import { ExtensionIdentifier, IExtension, ExtensionType, IExtensionDescription }
import { Schemas } from 'vs/base/common/network';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { IFileService } from 'vs/platform/files/common/files';
import { parseExtensionDevOptions } from 'vs/workbench/services/extensions/common/extensionDevOptions';
const hasOwnProperty = Object.hasOwnProperty;
const NO_OP_VOID_PROMISE = Promise.resolve<void>(undefined);
......@@ -843,7 +844,16 @@ export class ExtensionService extends Disposable implements IExtensionService {
}
public _onExtensionHostExit(code: number): void {
ipc.send('vscode:exit', code);
// Expected development extension termination: When the extension host goes down we also shutdown the window
const devOpts = parseExtensionDevOptions(this._environmentService);
if (!devOpts.isExtensionDevTestFromCli) {
this._windowService.closeWindow();
}
// When CLI testing make sure to exit with proper exit code
else {
ipc.send('vscode:exit', code);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册