MCPcopy
hub / github.com/VSCodeVim/Vim / execute

Method execute

src/cmd_line/commands/breakpoints.ts:154–183  ·  view source on GitHub ↗
(vimState: VimState)

Source from the content-addressed store, hash-verified

152 */
153class ListBreakpointsCommand extends ExCommand {
154 async execute(vimState: VimState): Promise<void> {
155 const breakpoints = vscode.debug.breakpoints;
156 type BreakpointQuickPick = { breakpointId: string } & vscode.QuickPickItem;
157 const lines = breakpoints.map((b, i): BreakpointQuickPick => {
158 const { id, enabled, condition } = b;
159 let label = '';
160 label += `#${i + 1}\t`;
161 label += enabled ? '$(circle-filled)\t' : '$(circle-outline)\t';
162 label += condition ? '$(debug-breakpoint-conditional)\t' : '\t';
163 if (isSourceBreakpoint(b))
164 label += `${path.basename(b.location.uri.fsPath)}:${b.location.range.start.line + 1}`;
165 if (isFunctionBreakpoint(b)) label += `$(debug-breakpoint-function)${b.functionName}`;
166 return {
167 label,
168 breakpointId: id,
169 };
170 });
171 await vscode.window.showQuickPick(lines).then(async (selected) => {
172 if (selected) {
173 const id = selected.breakpointId;
174 const breakpoint = breakpoints.find((b) => b.id === id);
175 if (breakpoint && isSourceBreakpoint(breakpoint)) {
176 const pos = breakpoint.location.range.start;
177 await vscode.window.showTextDocument(breakpoint.location.uri, {
178 selection: new vscode.Range(pos, pos),
179 });
180 }
181 }
182 });
183 }
184}
185
186export class Breakpoints {

Callers

nothing calls this directly

Calls 4

isSourceBreakpointFunction · 0.85
isFunctionBreakpointFunction · 0.85
basenameMethod · 0.80
findMethod · 0.80

Tested by

no test coverage detected