-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find the possible Breakpoints for a source line #72
Comments
I'd suggest to use a range (startLine, startColumn, endLine, endColumn) instead of just a line number:
|
A proposal: A new /** BreakpointLocations request; value of command field is 'breakpointLocations'.
The 'breakpointLocations' request returns all possible locations for source breakpoints in a given range.
*/
export interface BreakpointLocationsRequest extends Request {
// command: 'breakpointLocations';
arguments?: BreakpointLocationsArguments;
}
/** Arguments for 'breakpointLocations' request. */
export interface BreakpointLocationsArguments {
/** The source location of the breakpoints; either 'source.path' or 'source.reference' must be specified. */
source: Source;
/** Start line of range to search possible breakpoint locations in. If only the line is specified, the request returns all possible locations in that line. */
line: number;
/** Optional start column of range to search possible breakpoint locations in. If no start column is given, the first column in the start line is assumed. */
column?: number;
/** Optional end line of range to search possible breakpoint locations in. If no end line is given, then the end line is assumed to be the start line. */
endLine?: number;
/** Optional end column of range to search possible breakpoint locations in. If no end column is given, then it is assumed to be in the last column of the end line. */
endColumn?: number;
}
/** Response to 'breakpointLocations' request.
Contains possible locations for source breakpoints.
*/
export interface BreakpointLocationsResponse extends Response {
body: {
/** Sorted set of possible breakpoint locations. */
breakpoints: BreakpointLocation[];
};
} Returns an array of BreakpointLocations: /** Properties of a breakpoint location returned from the 'breakpointLocations' request. */
export interface BreakpointLocation {
/** Start line of breakpoint location. */
line: number;
/** Optional start column of breakpoint location. */
column?: number;
/** Optional end line of breakpoint location if the location covers a range. */
endLine?: number;
/** Optional end column of breakpoint location if the location covers a range. */
endColumn?: number;
} And the corresponding capability: /** Information about the capabilities of a debug adapter. */
export interface Capabilities {
// ...
/** The debug adapter supports the 'breakpointLocations' request. */
supportsBreakpointLocationsRequest?: boolean;
} /cc @dgozman @andrewcrawley @gregg-miskelly @int19h please let us know what you think. |
The one weird part about adding this is that, since it is a debug protocol request, anything you do with it will only be available while debugging and not at design time. So it might make more sense as a language service feature. But aside from that, this looks good to me. |
Yes, the scope of DAP is runtime not design time. But at least for JS/Node runtimes column breakpoint information would not be available through a language service either since it depends on transpilation and runtime versions. |
Makes sense. I would suspect for most languages this would not be the case. But I can see how JavaScript would be different. |
In order to provide visual hints for all possible breakpoint locations in a source line, a new request
getPossibleBreakpoints
is needed.The text was updated successfully, but these errors were encountered: