提交 9ec07836 编写于 作者: I isidor

debug: alllow to resize Breakpoints section in Debug sidebar

fixes #46886
上级 8b919e49
......@@ -51,9 +51,9 @@ function createCheckbox(): HTMLInputElement {
}
const MAX_VISIBLE_BREAKPOINTS = 9;
export function getExpandedBodySize(model: IDebugModel): number {
export function getExpandedBodySize(model: IDebugModel, countLimit: number): number {
const length = model.getBreakpoints().length + model.getExceptionBreakpoints().length + model.getFunctionBreakpoints().length + model.getDataBreakpoints().length;
return Math.min(MAX_VISIBLE_BREAKPOINTS, length) * 22;
return Math.min(countLimit, length) * 22;
}
type BreakpointItem = IBreakpoint | IFunctionBreakpoint | IDataBreakpoint | IExceptionBreakpoint;
......@@ -233,8 +233,8 @@ export class BreakpointsView extends ViewPane {
private updateSize(): void {
// Adjust expanded body size
this.minimumBodySize = this.orientation === Orientation.VERTICAL ? getExpandedBodySize(this.debugService.getModel()) : 170;
this.maximumBodySize = this.orientation === Orientation.VERTICAL ? this.minimumBodySize : Number.POSITIVE_INFINITY;
this.minimumBodySize = this.orientation === Orientation.VERTICAL ? getExpandedBodySize(this.debugService.getModel(), MAX_VISIBLE_BREAKPOINTS) : 170;
this.maximumBodySize = this.orientation === Orientation.VERTICAL ? getExpandedBodySize(this.debugService.getModel(), Number.POSITIVE_INFINITY) : Number.POSITIVE_INFINITY;
}
private onBreakpointsChange(): void {
......
......@@ -98,10 +98,10 @@ suite('Debug - Breakpoints', () => {
const modelUri1 = uri.file('/myfolder/my file first.js');
const modelUri2 = uri.file('/secondfolder/second/second file.js');
addBreakpointsAndCheckEvents(model, modelUri1, [{ lineNumber: 5, enabled: true }, { lineNumber: 10, enabled: false }]);
assert.equal(getExpandedBodySize(model), 44);
assert.equal(getExpandedBodySize(model, 9), 44);
addBreakpointsAndCheckEvents(model, modelUri2, [{ lineNumber: 1, enabled: true }, { lineNumber: 2, enabled: true }, { lineNumber: 3, enabled: false }]);
assert.equal(getExpandedBodySize(model), 110);
assert.equal(getExpandedBodySize(model, 9), 110);
assert.equal(model.getBreakpoints().length, 5);
assert.equal(model.getBreakpoints({ uri: modelUri1 }).length, 2);
......@@ -135,7 +135,7 @@ suite('Debug - Breakpoints', () => {
assert.equal(bp.enabled, true);
model.removeBreakpoints(model.getBreakpoints({ uri: modelUri1 }));
assert.equal(getExpandedBodySize(model), 66);
assert.equal(getExpandedBodySize(model, 9), 66);
assert.equal(model.getBreakpoints().length, 3);
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册