From 5b5bb81e2cb60ca1419a80e02141a6e8bf899fd7 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Fri, 31 Jul 2020 12:30:48 -0700 Subject: [PATCH] fix: inherit the compound root for all children of debug sessions Fixes https://github.com/microsoft/vscode/issues/103705 --- src/vs/workbench/api/browser/mainThreadDebugService.ts | 6 ++++-- src/vs/workbench/contrib/debug/browser/debugSession.ts | 5 +++++ src/vs/workbench/contrib/debug/common/debug.ts | 1 + src/vs/workbench/contrib/debug/test/common/mockDebug.ts | 5 +++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadDebugService.ts b/src/vs/workbench/api/browser/mainThreadDebugService.ts index 978e6416a5d..907f2886311 100644 --- a/src/vs/workbench/api/browser/mainThreadDebugService.ts +++ b/src/vs/workbench/api/browser/mainThreadDebugService.ts @@ -228,11 +228,13 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb public $startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, options: IStartDebuggingOptions): Promise { const folderUri = folder ? uri.revive(folder) : undefined; const launch = this.debugService.getConfigurationManager().getLaunch(folderUri); + const parentSession = this.getSession(options.parentSessionID); const debugOptions: IDebugSessionOptions = { noDebug: options.noDebug, - parentSession: this.getSession(options.parentSessionID), + parentSession, repl: options.repl, - compact: options.compact + compact: options.compact, + compoundRoot: parentSession?.compoundRoot }; return this.debugService.startDebugging(launch, nameOrConfig, debugOptions).then(success => { return success; diff --git a/src/vs/workbench/contrib/debug/browser/debugSession.ts b/src/vs/workbench/contrib/debug/browser/debugSession.ts index 2e9f48decec..cd67a54853f 100644 --- a/src/vs/workbench/contrib/debug/browser/debugSession.ts +++ b/src/vs/workbench/contrib/debug/browser/debugSession.ts @@ -36,6 +36,7 @@ import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { localize } from 'vs/nls'; import { canceled } from 'vs/base/common/errors'; import { filterExceptionsFromTelemetry } from 'vs/workbench/contrib/debug/common/debugUtils'; +import { DebugCompoundRoot } from 'vs/workbench/contrib/debug/common/debugCompoundRoot'; export class DebugSession implements IDebugSession { @@ -133,6 +134,10 @@ export class DebugSession implements IDebugSession { return !!this._options.compact; } + get compoundRoot(): DebugCompoundRoot | undefined { + return this._options.compoundRoot; + } + setConfiguration(configuration: { resolved: IConfig, unresolved: IConfig | undefined }) { this._configuration = configuration; } diff --git a/src/vs/workbench/contrib/debug/common/debug.ts b/src/vs/workbench/contrib/debug/common/debug.ts index 9182f823920..d74d8cce52f 100644 --- a/src/vs/workbench/contrib/debug/common/debug.ts +++ b/src/vs/workbench/contrib/debug/common/debug.ts @@ -169,6 +169,7 @@ export interface IDebugSession extends ITreeElement { readonly parentSession: IDebugSession | undefined; readonly subId: string | undefined; readonly compact: boolean; + readonly compoundRoot: DebugCompoundRoot | undefined; setSubId(subId: string | undefined): void; diff --git a/src/vs/workbench/contrib/debug/test/common/mockDebug.ts b/src/vs/workbench/contrib/debug/test/common/mockDebug.ts index 5802ba6c993..7e9b4377b82 100644 --- a/src/vs/workbench/contrib/debug/test/common/mockDebug.ts +++ b/src/vs/workbench/contrib/debug/test/common/mockDebug.ts @@ -13,6 +13,7 @@ import Severity from 'vs/base/common/severity'; import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/common/abstractDebugAdapter'; import { DebugStorage } from 'vs/workbench/contrib/debug/common/debugStorage'; import { ExceptionBreakpoint, Expression, DataBreakpoint, FunctionBreakpoint, Breakpoint, DebugModel } from 'vs/workbench/contrib/debug/common/debugModel'; +import { DebugCompoundRoot } from 'vs/workbench/contrib/debug/common/debugCompoundRoot'; export class MockDebugService implements IDebugService { @@ -135,6 +136,10 @@ export class MockDebugService implements IDebugService { } export class MockSession implements IDebugSession { + get compoundRoot(): DebugCompoundRoot | undefined { + return undefined; + } + stepInTargets(frameId: number): Promise<{ id: number; label: string; }[]> { throw new Error('Method not implemented.'); }