Repository: microsoft/vscode
File: src/vs/workbench/contrib/debug/browser/breakpointsView.ts (TypeScript)

Code before:
			}

			// Create folder items for each file
			for (const [uriStr, breakpoints] of breakpointsByUri) {
				const uri = URI.parse(uriStr);
				const folderItem = new BreakpointsFolderItem(uri, breakpoints);

				// Sort breakpoints by line number
				breakpoints.sort((a, b) => a.lineNumber - b.lineNumber);

				const children: ICompressedTreeElement<BreakpointTreeElement>[] = breakpoints.map(bp => ({
					element: bp,
					incompressible: false
				}));

				result.push({
					element: folderItem,
					incompressible: false,
					collapsed: this.collapsedState.has(folderItem.getId()),
					children
				});

				// Mark as initialized (expanded by default on first render)
				if (!this.collapsedState.has(`_init_${folderItem.getId()}`)) {
					this.collapsedState.add(`_init_${folderItem.getId()}`);
				}
			}
		} else {
			// Flat mode - just add all source breakpoints
			for (const bp of sourceBreakpoints) {
				result.push({ element: bp, incompressible: true });
			}
		}

		// Instruction breakpoints (root level)
		for (const instrBp of model.getInstructionBreakpoints()) {
			result.push({ element: instrBp, incompressible: true });
		}

		return result;
	}

	private get flatElements(): BreakpointItem[] {
		const model = this.debugService.getModel();
		const sessionId = this.debugService.getViewModel().focusedSession?.getId();
		const elements = (<ReadonlyArray<IEnablement>>model.getExceptionBreakpointsForSession(sessionId)).concat(model.getFunctionBreakpoints()).concat(model.getDataBreakpoints()).concat(model.getBreakpoints()).concat(model.getInstructionBreakpoints());

		return elements as BreakpointItem[];
	}
}


Review comment (suggestion):
@copilot we can get rid of the `if` block as `_init_` is no longer used.

Code after:
			}

			// Create folder items for each file
			for (const [uriStr, breakpoints] of breakpointsByUri) {
				const uri = URI.parse(uriStr);
				const folderItem = new BreakpointsFolderItem(uri, breakpoints);

				// Sort breakpoints by line number
				breakpoints.sort((a, b) => a.lineNumber - b.lineNumber);

				const children: ICompressedTreeElement<BreakpointTreeElement>[] = breakpoints.map(bp => ({
					element: bp,
					incompressible: false
				}));

				result.push({
					element: folderItem,
					incompressible: false,
					collapsed: this.collapsedState.has(folderItem.getId()),
					children
				});
			}
		} else {
			// Flat mode - just add all source breakpoints
			for (const bp of sourceBreakpoints) {
				result.push({ element: bp, incompressible: true });
			}
		}

		// Instruction breakpoints (root level)
		for (const instrBp of model.getInstructionBreakpoints()) {
			result.push({ element: instrBp, incompressible: true });
		}

		return result;
	}

	private get flatElements(): BreakpointItem[] {
		const model = this.debugService.getModel();
		const sessionId = this.debugService.getViewModel().focusedSession?.getId();
		const elements = (<ReadonlyArray<IEnablement>>model.getExceptionBreakpointsForSession(sessionId)).concat(model.getFunctionBreakpoints()).concat(model.getDataBreakpoints()).concat(model.getBreakpoints()).concat(model.getInstructionBreakpoints());

		return elements as BreakpointItem[];
	}
}

class BreakpointsDelegate implements IListVirtualDelegate<BreakpointTreeElement> {

	constructor(private view: BreakpointsView) {
		// noop
	}