Skip to content

Commit ef5f7a6

Browse files
committed
make maximum number of lines in debug console configurable
1 parent 95b0300 commit ef5f7a6

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,11 @@ configurationRegistry.registerConfiguration({
599599
description: nls.localize('debug.console.acceptSuggestionOnEnter', "Controls whether suggestions should be accepted on Enter in the Debug Console. Enter is also used to evaluate whatever is typed in the Debug Console."),
600600
default: 'off'
601601
},
602+
'debug.console.maximumLines': {
603+
type: 'number',
604+
description: nls.localize('debug.console.maximumLines', "Controls the maximum number of lines in the Debug Console."),
605+
default: 10000
606+
},
602607
'launch': {
603608
type: 'object',
604609
description: nls.localize({ comment: ['This is the description for a setting'], key: 'launch' }, "Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces."),

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

+1
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,7 @@ export interface IDebugConfiguration {
809809
collapseIdenticalLines: boolean;
810810
historySuggestions: boolean;
811811
acceptSuggestionOnEnter: 'off' | 'on';
812+
maximumLines: number;
812813
};
813814
focusWindowOnBreak: boolean;
814815
focusEditorOnBreak: boolean;

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { IConfigurationService } from '../../../../platform/configuration/common
1212
import { IDebugConfiguration, IDebugSession, IExpression, INestingReplElement, IReplElement, IReplElementSource, IStackFrame } from './debug.js';
1313
import { ExpressionContainer } from './debugModel.js';
1414

15-
const MAX_REPL_LENGTH = 10000;
1615
let topReplElementCounter = 0;
1716
const getUniqueId = () => `topReplElement:${topReplElementCounter++}`;
1817

@@ -343,8 +342,9 @@ export class ReplModel {
343342
lastElement.addChild(newElement);
344343
} else {
345344
this.replElements.push(newElement);
346-
if (this.replElements.length > MAX_REPL_LENGTH) {
347-
this.replElements.splice(0, this.replElements.length - MAX_REPL_LENGTH);
345+
const config = this.configurationService.getValue<IDebugConfiguration>('debug');
346+
if (this.replElements.length > config.console.maximumLines) {
347+
this.replElements.splice(0, this.replElements.length - config.console.maximumLines);
348348
}
349349
}
350350
this._onDidChangeElements.fire(newElement);

0 commit comments

Comments
 (0)