Skip to content

Expose DAP IDs of breakpoints in vscode API #99716

Closed
@connor4312

Description

@connor4312

For performance profiling, we let users pick the breakpoints to run to. For this I need to know the DAP ID of the breakpoint, since that's what my debug adapter, in turn, knows about. However, the breakpoint IDs exposed on the API only have a GUID which does not seem correlated with anything else.

In the past I got around this by just having a custom "get breakpoints" request through DAP that returned the breakpoints from the debug adapter and we can show the right UI. But with Jackson's good suggestion here #96473 (comment) I now also want to get the file URI of the breakpoint to show it as a preview.

This ultimately means I need to either redo the URI-generation behavior, or have logic to correlate my DAP breakpoints with debug breakpoints. I ended up doing the latter, but it would be much nicer if breakpoints had some API like:

getDapIdInSession(session: DebugSession): string | undefined;

My current hack-around: https://github.com/microsoft/vscode-js-debug/blob/88e380e64f5bac3a722f879a95793e2688bd4062/src/ui/profiling/breakpointTerminationCondition.ts#L58-L71

const vscodeBp = vscode.debug.breakpoints.find(
  (bp): bp is vscode.SourceBreakpoint =>
    bp instanceof vscode.SourceBreakpoint &&
    bp.enabled &&
    bp.location.range.start.line === line - 1 &&
    comparePathsWithoutCasingOrSlashes(bp.location.uri.fsPath, path),
);

Metadata

Metadata

Assignees

Labels

apiapi-finalizationdebugDebug viewlet, configurations, breakpoints, adapter issuesinsiders-releasedPatch has been released in VS Code Insiders

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions