提交 4be4a427 编写于 作者: B Benjamin Pasero 提交者: GitHub

Merge pull request #23586 from Microsoft/weinand-patch-1

prevent reload window closes the debuggee; fixes #23390
......@@ -76,7 +76,8 @@ export class ExtensionHostProcessWorker {
private isExtensionDevelopmentHost: boolean;
private isExtensionDevelopmentTestFromCli: boolean;
private isExtensionDevelopmentDebugging: boolean;
private isExtensionDevelopmentDebug: boolean;
private isExtensionDevelopmentDebugBrk: boolean;
public readonly messagingProtocol = new LazyMessagePassingProtol();
......@@ -95,7 +96,8 @@ export class ExtensionHostProcessWorker {
) {
// handle extension host lifecycle a bit special when we know we are developing an extension that runs inside
this.isExtensionDevelopmentHost = environmentService.isExtensionDevelopment;
this.isExtensionDevelopmentDebugging = !!environmentService.debugExtensionHost.break;
this.isExtensionDevelopmentDebug = (typeof environmentService.debugExtensionHost.port === 'number');
this.isExtensionDevelopmentDebugBrk = !!environmentService.debugExtensionHost.break;
this.isExtensionDevelopmentTestFromCli = this.isExtensionDevelopmentHost && !!environmentService.extensionTestsPath && !environmentService.debugExtensionHost.break;
lifecycleService.onWillShutdown(this._onWillShutdown, this);
......@@ -124,7 +126,7 @@ export class ExtensionHostProcessWorker {
// (i.e. extension host) is taken down in a brutal fashion by the OS
detached: !!isWindows,
execArgv: port
? ['--nolazy', (this.isExtensionDevelopmentDebugging ? '--debug-brk=' : '--debug=') + port]
? ['--nolazy', (this.isExtensionDevelopmentDebugBrk ? '--debug-brk=' : '--debug=') + port]
: undefined
};
......@@ -156,7 +158,7 @@ export class ExtensionHostProcessWorker {
let startupTimeoutHandle: number;
if (!this.environmentService.isBuilt || this.isExtensionDevelopmentHost) {
startupTimeoutHandle = setTimeout(() => {
const msg = this.isExtensionDevelopmentDebugging
const msg = this.isExtensionDevelopmentDebugBrk
? nls.localize('extensionHostProcess.startupFailDebug', "Extension host did not start in 10 seconds, it might be stopped on the first line and needs a debugger to continue.")
: nls.localize('extensionHostProcess.startupFail', "Extension host did not start in 10 seconds, that might be a problem.");
......@@ -198,7 +200,7 @@ export class ExtensionHostProcessWorker {
if (port !== extensionHostPort) {
console.warn(`%c[Extension Host] %cProvided debugging port ${extensionHostPort} is not free, using ${port} instead.`, 'color: blue', 'color: black');
}
if (this.isExtensionDevelopmentDebugging) {
if (this.isExtensionDevelopmentDebugBrk) {
console.warn(`%c[Extension Host] %cSTOPPED on first line for debugging on port ${port}`, 'color: blue', 'color: black');
} else {
console.info(`%c[Extension Host] %cdebugger listening on port ${port}`, 'color: blue', 'color: black');
......@@ -346,7 +348,7 @@ export class ExtensionHostProcessWorker {
// If the extension development host was started without debugger attached we need
// to communicate this back to the main side to terminate the debug session
if (this.isExtensionDevelopmentHost && !this.isExtensionDevelopmentTestFromCli && !this.isExtensionDevelopmentDebugging) {
if (this.isExtensionDevelopmentHost && !this.isExtensionDevelopmentTestFromCli && !this.isExtensionDevelopmentDebug) {
this.windowService.broadcast({
channel: EXTENSION_TERMINATE_BROADCAST_CHANNEL,
payload: true
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册