Skip to content

Commit 5b5bb81

Browse files
committed
fix: inherit the compound root for all children of debug sessions
Fixes microsoft#103705
1 parent 348a4ce commit 5b5bb81

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/vs/workbench/api/browser/mainThreadDebugService.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,13 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
228228
public $startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, options: IStartDebuggingOptions): Promise<boolean> {
229229
const folderUri = folder ? uri.revive(folder) : undefined;
230230
const launch = this.debugService.getConfigurationManager().getLaunch(folderUri);
231+
const parentSession = this.getSession(options.parentSessionID);
231232
const debugOptions: IDebugSessionOptions = {
232233
noDebug: options.noDebug,
233-
parentSession: this.getSession(options.parentSessionID),
234+
parentSession,
234235
repl: options.repl,
235-
compact: options.compact
236+
compact: options.compact,
237+
compoundRoot: parentSession?.compoundRoot
236238
};
237239
return this.debugService.startDebugging(launch, nameOrConfig, debugOptions).then(success => {
238240
return success;

src/vs/workbench/contrib/debug/browser/debugSession.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
3636
import { localize } from 'vs/nls';
3737
import { canceled } from 'vs/base/common/errors';
3838
import { filterExceptionsFromTelemetry } from 'vs/workbench/contrib/debug/common/debugUtils';
39+
import { DebugCompoundRoot } from 'vs/workbench/contrib/debug/common/debugCompoundRoot';
3940

4041
export class DebugSession implements IDebugSession {
4142

@@ -133,6 +134,10 @@ export class DebugSession implements IDebugSession {
133134
return !!this._options.compact;
134135
}
135136

137+
get compoundRoot(): DebugCompoundRoot | undefined {
138+
return this._options.compoundRoot;
139+
}
140+
136141
setConfiguration(configuration: { resolved: IConfig, unresolved: IConfig | undefined }) {
137142
this._configuration = configuration;
138143
}

src/vs/workbench/contrib/debug/common/debug.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ export interface IDebugSession extends ITreeElement {
169169
readonly parentSession: IDebugSession | undefined;
170170
readonly subId: string | undefined;
171171
readonly compact: boolean;
172+
readonly compoundRoot: DebugCompoundRoot | undefined;
172173

173174
setSubId(subId: string | undefined): void;
174175

src/vs/workbench/contrib/debug/test/common/mockDebug.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Severity from 'vs/base/common/severity';
1313
import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/common/abstractDebugAdapter';
1414
import { DebugStorage } from 'vs/workbench/contrib/debug/common/debugStorage';
1515
import { ExceptionBreakpoint, Expression, DataBreakpoint, FunctionBreakpoint, Breakpoint, DebugModel } from 'vs/workbench/contrib/debug/common/debugModel';
16+
import { DebugCompoundRoot } from 'vs/workbench/contrib/debug/common/debugCompoundRoot';
1617

1718
export class MockDebugService implements IDebugService {
1819

@@ -135,6 +136,10 @@ export class MockDebugService implements IDebugService {
135136
}
136137

137138
export class MockSession implements IDebugSession {
139+
get compoundRoot(): DebugCompoundRoot | undefined {
140+
return undefined;
141+
}
142+
138143
stepInTargets(frameId: number): Promise<{ id: number; label: string; }[]> {
139144
throw new Error('Method not implemented.');
140145
}

0 commit comments

Comments
 (0)