diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 40c73e63abc..0cc285c6071 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -831,10 +831,10 @@ declare module 'vscode' { /** * Controls if the debug session's parent session is shown in the CALL STACK view even if it has only a single child. - * By default, debug sessions with a single child are hidden in the CALL STACK view to make the tree more compact. - * If noCompact is true, then the debug session will never hide its parent. + * By default, the debug session will never hide its parent. + * If compact is true, debug sessions with a single child are hidden in the CALL STACK view to make the tree more compact. */ - noCompact?: boolean; + compact?: boolean; } // deprecated debug API diff --git a/src/vs/workbench/api/browser/mainThreadDebugService.ts b/src/vs/workbench/api/browser/mainThreadDebugService.ts index eada65f9f62..1ddadf87184 100644 --- a/src/vs/workbench/api/browser/mainThreadDebugService.ts +++ b/src/vs/workbench/api/browser/mainThreadDebugService.ts @@ -232,7 +232,7 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb noDebug: options.noDebug, parentSession: this.getSession(options.parentSessionID), repl: options.repl, - noCompact: options.noCompact + compact: options.compact }; return this.debugService.startDebugging(launch, nameOrConfig, debugOptions).then(success => { return success; diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 23497dc06b2..0490360f285 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -858,7 +858,7 @@ export interface IStartDebuggingOptions { parentSessionID?: DebugSessionUUID; repl?: IDebugSessionReplMode; noDebug?: boolean; - noCompact?: boolean; + compact?: boolean; } export interface MainThreadDebugServiceShape extends IDisposable { diff --git a/src/vs/workbench/api/common/extHostDebugService.ts b/src/vs/workbench/api/common/extHostDebugService.ts index f9b766a8106..6fc0dc2bdc1 100644 --- a/src/vs/workbench/api/common/extHostDebugService.ts +++ b/src/vs/workbench/api/common/extHostDebugService.ts @@ -297,7 +297,7 @@ export abstract class ExtHostDebugServiceBase implements IExtHostDebugService, E parentSessionID: options.parentSession ? options.parentSession.id : undefined, repl: options.consoleMode === DebugConsoleMode.MergeWithParent ? 'mergeWithParent' : 'separate', noDebug: options.noDebug, - noCompact: options.noCompact + compact: options.compact }); } diff --git a/src/vs/workbench/contrib/debug/browser/callStackView.ts b/src/vs/workbench/contrib/debug/browser/callStackView.ts index 7e27b4b03d5..9fb005a0a79 100644 --- a/src/vs/workbench/contrib/debug/browser/callStackView.ts +++ b/src/vs/workbench/contrib/debug/browser/callStackView.ts @@ -217,7 +217,7 @@ export class CallStackView extends ViewPane { this.dataSource = new CallStackDataSource(this.debugService); const sessionsRenderer = this.instantiationService.createInstance(SessionsRenderer, this.menu); - this.tree = >this.instantiationService.createInstance(WorkbenchCompressibleAsyncDataTree, 'CallStackView', treeContainer, new CallStackDelegate(), new CallStackCompressionDelegate(), [ + this.tree = >this.instantiationService.createInstance(WorkbenchCompressibleAsyncDataTree, 'CallStackView', treeContainer, new CallStackDelegate(), new CallStackCompressionDelegate(this.debugService), [ sessionsRenderer, new ThreadsRenderer(this.instantiationService), this.instantiationService.createInstance(StackFramesRenderer), @@ -1104,9 +1104,20 @@ class ContinueAction extends Action { } class CallStackCompressionDelegate implements ITreeCompressionDelegate { + + constructor(private readonly debugService: IDebugService) { } + isIncompressible(stat: CallStackItem): boolean { if (isDebugSession(stat)) { - return stat.noCompact; + if (stat.compact) { + return false; + } + const sessions = this.debugService.getModel().getSessions(); + if (sessions.some(s => s.parentSession === stat && s.compact)) { + return false; + } + + return true; } return true; diff --git a/src/vs/workbench/contrib/debug/browser/debugSession.ts b/src/vs/workbench/contrib/debug/browser/debugSession.ts index 7272b2333cc..f6d4e37cbb8 100644 --- a/src/vs/workbench/contrib/debug/browser/debugSession.ts +++ b/src/vs/workbench/contrib/debug/browser/debugSession.ts @@ -129,8 +129,8 @@ export class DebugSession implements IDebugSession { return this._options.parentSession; } - get noCompact(): boolean { - return !!this._options.noCompact; + get compact(): boolean { + return !!this._options.compact; } setConfiguration(configuration: { resolved: IConfig, unresolved: IConfig | undefined }) { diff --git a/src/vs/workbench/contrib/debug/common/debug.ts b/src/vs/workbench/contrib/debug/common/debug.ts index 7692955d9ed..84adc75d705 100644 --- a/src/vs/workbench/contrib/debug/common/debug.ts +++ b/src/vs/workbench/contrib/debug/common/debug.ts @@ -157,7 +157,7 @@ export interface IDebugSessionOptions { parentSession?: IDebugSession; repl?: IDebugSessionReplMode; compoundRoot?: DebugCompoundRoot; - noCompact?: boolean; + compact?: boolean; } export interface IDebugSession extends ITreeElement { @@ -168,7 +168,7 @@ export interface IDebugSession extends ITreeElement { readonly root: IWorkspaceFolder | undefined; readonly parentSession: IDebugSession | undefined; readonly subId: string | undefined; - readonly noCompact: boolean; + readonly compact: boolean; 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 6576e21e88e..1b3b1f2beba 100644 --- a/src/vs/workbench/contrib/debug/test/common/mockDebug.ts +++ b/src/vs/workbench/contrib/debug/test/common/mockDebug.ts @@ -157,7 +157,7 @@ export class MockSession implements IDebugSession { subId: string | undefined; - get noCompact(): boolean { + get compact(): boolean { return false; }