From 67b4efe22c514e2cc3856f5ff7f8d61ed25701c6 Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Tue, 20 Jul 2021 17:23:40 +0200 Subject: [PATCH] new DebugSessionOption 'lifecycleManagedByParent'; fixes #128058 --- src/vs/vscode.d.ts | 7 +++++++ src/vs/vscode.proposed.d.ts | 9 +-------- src/vs/workbench/api/browser/mainThreadDebugService.ts | 1 + src/vs/workbench/api/common/extHost.protocol.ts | 1 + src/vs/workbench/api/common/extHostDebugService.ts | 1 + src/vs/workbench/contrib/debug/common/debug.ts | 1 + 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index ac3a3dfa2c0..afb75829156 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -13066,6 +13066,13 @@ declare module 'vscode' { */ parentSession?: DebugSession; + /** + * Controls whether lifecycle requests like 'restart' are sent to the newly created session or its parent session. + * By default (if the property is false or missing), lifecycle requests are sent to the new session. + * This property is ignored if the session has no parent session. + */ + lifecycleManagedByParent?: boolean; + /** * Controls whether this session should have a separate debug console or share it * with the parent session. Has no effect for sessions which do not have a parent session. diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index df942061160..28f9ac7f7de 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -684,20 +684,13 @@ declare module 'vscode' { //#endregion // eslint-disable-next-line vscode-dts-region-comments - //#region @weinand: new debug session option 'managedByParent' (see https://github.com/microsoft/vscode/issues/128058) + //#region @roblourens: new debug session option for simple UI 'managedByParent' (see https://github.com/microsoft/vscode/issues/128588) /** * Options for {@link debug.startDebugging starting a debug session}. */ export interface DebugSessionOptions { - /** - * Controls whether lifecycle requests like 'restart' are sent to the newly created session or its parent session. - * By default (if the property is false or missing), lifecycle requests are sent to the new session. - * This property is ignored if the session has no parent session. - */ - lifecycleManagedByParent?: boolean; - debugUI?: { /** * When true, the debug toolbar will not be shown for this session, the window statusbar color will not be changed, and the debug viewlet will not be automatically revealed. diff --git a/src/vs/workbench/api/browser/mainThreadDebugService.ts b/src/vs/workbench/api/browser/mainThreadDebugService.ts index 57a33806371..8d376009a32 100644 --- a/src/vs/workbench/api/browser/mainThreadDebugService.ts +++ b/src/vs/workbench/api/browser/mainThreadDebugService.ts @@ -226,6 +226,7 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb const debugOptions: IDebugSessionOptions = { noDebug: options.noDebug, parentSession, + lifecycleManagedByParent: options.lifecycleManagedByParent, repl: options.repl, compact: options.compact, debugUI: options.debugUI, diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 2a4e3c09f1a..951e83cd9d8 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -1094,6 +1094,7 @@ export interface IDebugConfiguration { export interface IStartDebuggingOptions { parentSessionID?: DebugSessionUUID; + lifecycleManagedByParent?: boolean; repl?: IDebugSessionReplMode; noDebug?: boolean; compact?: boolean; diff --git a/src/vs/workbench/api/common/extHostDebugService.ts b/src/vs/workbench/api/common/extHostDebugService.ts index 4036d60e099..e05e8173354 100644 --- a/src/vs/workbench/api/common/extHostDebugService.ts +++ b/src/vs/workbench/api/common/extHostDebugService.ts @@ -289,6 +289,7 @@ export abstract class ExtHostDebugServiceBase implements IExtHostDebugService, E public startDebugging(folder: vscode.WorkspaceFolder | undefined, nameOrConfig: string | vscode.DebugConfiguration, options: vscode.DebugSessionOptions): Promise { return this._debugServiceProxy.$startDebugging(folder ? folder.uri : undefined, nameOrConfig, { parentSessionID: options.parentSession ? options.parentSession.id : undefined, + lifecycleManagedByParent: options.lifecycleManagedByParent, repl: options.consoleMode === DebugConsoleMode.MergeWithParent ? 'mergeWithParent' : 'separate', noDebug: options.noDebug, compact: options.compact, diff --git a/src/vs/workbench/contrib/debug/common/debug.ts b/src/vs/workbench/contrib/debug/common/debug.ts index 6a9b9810c48..5565b407bb9 100644 --- a/src/vs/workbench/contrib/debug/common/debug.ts +++ b/src/vs/workbench/contrib/debug/common/debug.ts @@ -177,6 +177,7 @@ export type IDebugSessionReplMode = 'separate' | 'mergeWithParent'; export interface IDebugSessionOptions { noDebug?: boolean; parentSession?: IDebugSession; + lifecycleManagedByParent?: boolean; repl?: IDebugSessionReplMode; compoundRoot?: DebugCompoundRoot; compact?: boolean;