Skip to content

Commit a301dc5

Browse files
committed
change noCompress -> compress and make default to not compress sessions in call stack
microsoft#101429
1 parent 819bc73 commit a301dc5

8 files changed

Lines changed: 24 additions & 13 deletions

File tree

src/vs/vscode.proposed.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -831,10 +831,10 @@ declare module 'vscode' {
831831

832832
/**
833833
* Controls if the debug session's parent session is shown in the CALL STACK view even if it has only a single child.
834-
* By default, debug sessions with a single child are hidden in the CALL STACK view to make the tree more compact.
835-
* If noCompact is true, then the debug session will never hide its parent.
834+
* By default, the debug session will never hide its parent.
835+
* If compact is true, debug sessions with a single child are hidden in the CALL STACK view to make the tree more compact.
836836
*/
837-
noCompact?: boolean;
837+
compact?: boolean;
838838
}
839839

840840
// deprecated debug API

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
232232
noDebug: options.noDebug,
233233
parentSession: this.getSession(options.parentSessionID),
234234
repl: options.repl,
235-
noCompact: options.noCompact
235+
compact: options.compact
236236
};
237237
return this.debugService.startDebugging(launch, nameOrConfig, debugOptions).then(success => {
238238
return success;

src/vs/workbench/api/common/extHost.protocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ export interface IStartDebuggingOptions {
858858
parentSessionID?: DebugSessionUUID;
859859
repl?: IDebugSessionReplMode;
860860
noDebug?: boolean;
861-
noCompact?: boolean;
861+
compact?: boolean;
862862
}
863863

864864
export interface MainThreadDebugServiceShape extends IDisposable {

src/vs/workbench/api/common/extHostDebugService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export abstract class ExtHostDebugServiceBase implements IExtHostDebugService, E
297297
parentSessionID: options.parentSession ? options.parentSession.id : undefined,
298298
repl: options.consoleMode === DebugConsoleMode.MergeWithParent ? 'mergeWithParent' : 'separate',
299299
noDebug: options.noDebug,
300-
noCompact: options.noCompact
300+
compact: options.compact
301301
});
302302
}
303303

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export class CallStackView extends ViewPane {
217217

218218
this.dataSource = new CallStackDataSource(this.debugService);
219219
const sessionsRenderer = this.instantiationService.createInstance(SessionsRenderer, this.menu);
220-
this.tree = <WorkbenchCompressibleAsyncDataTree<IDebugModel, CallStackItem, FuzzyScore>>this.instantiationService.createInstance(WorkbenchCompressibleAsyncDataTree, 'CallStackView', treeContainer, new CallStackDelegate(), new CallStackCompressionDelegate(), [
220+
this.tree = <WorkbenchCompressibleAsyncDataTree<IDebugModel, CallStackItem, FuzzyScore>>this.instantiationService.createInstance(WorkbenchCompressibleAsyncDataTree, 'CallStackView', treeContainer, new CallStackDelegate(), new CallStackCompressionDelegate(this.debugService), [
221221
sessionsRenderer,
222222
new ThreadsRenderer(this.instantiationService),
223223
this.instantiationService.createInstance(StackFramesRenderer),
@@ -1104,9 +1104,20 @@ class ContinueAction extends Action {
11041104
}
11051105

11061106
class CallStackCompressionDelegate implements ITreeCompressionDelegate<CallStackItem> {
1107+
1108+
constructor(private readonly debugService: IDebugService) { }
1109+
11071110
isIncompressible(stat: CallStackItem): boolean {
11081111
if (isDebugSession(stat)) {
1109-
return stat.noCompact;
1112+
if (stat.compact) {
1113+
return false;
1114+
}
1115+
const sessions = this.debugService.getModel().getSessions();
1116+
if (sessions.some(s => s.parentSession === stat && s.compact)) {
1117+
return false;
1118+
}
1119+
1120+
return true;
11101121
}
11111122

11121123
return true;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ export class DebugSession implements IDebugSession {
129129
return this._options.parentSession;
130130
}
131131

132-
get noCompact(): boolean {
133-
return !!this._options.noCompact;
132+
get compact(): boolean {
133+
return !!this._options.compact;
134134
}
135135

136136
setConfiguration(configuration: { resolved: IConfig, unresolved: IConfig | undefined }) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export interface IDebugSessionOptions {
157157
parentSession?: IDebugSession;
158158
repl?: IDebugSessionReplMode;
159159
compoundRoot?: DebugCompoundRoot;
160-
noCompact?: boolean;
160+
compact?: boolean;
161161
}
162162

163163
export interface IDebugSession extends ITreeElement {
@@ -168,7 +168,7 @@ export interface IDebugSession extends ITreeElement {
168168
readonly root: IWorkspaceFolder | undefined;
169169
readonly parentSession: IDebugSession | undefined;
170170
readonly subId: string | undefined;
171-
readonly noCompact: boolean;
171+
readonly compact: boolean;
172172

173173
setSubId(subId: string | undefined): void;
174174

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export class MockSession implements IDebugSession {
157157

158158
subId: string | undefined;
159159

160-
get noCompact(): boolean {
160+
get compact(): boolean {
161161
return false;
162162
}
163163

0 commit comments

Comments
 (0)