(vimState: VimState)
| 152 | */ |
| 153 | class 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 | |
| 186 | export class Breakpoints { |
nothing calls this directly
no test coverage detected