Skip to content

Commit 2c2fe74

Browse files
authored
Proposed protocol addition "step-into-specifc" #39
1 parent 3033785 commit 2c2fe74

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

protocol/src/debugProtocol.ts

+44-1
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,12 @@ export module DebugProtocol {
348348
}
349349

350350
/** StepIn request; value of command field is "stepIn".
351-
The request starts the debuggee to run again for one step.
351+
The request starts the debuggee to step into a function/method if possible.
352+
If it cannot step into a target, "stepIn" behaves like "next".
352353
The debug adapter first sends the StepInResponse and then a StoppedEvent (event type 'step') after the step has completed.
354+
If there are multiple function/method calls (or other targets) on the source line,
355+
the optional argument 'targetId' can be used to control into which target the "stepIn" should occur.
356+
The list of possible targets for a given source line can be retrieved via the "stepInTargets" request.
353357
*/
354358
export interface StepInRequest extends Request {
355359
arguments: StepInArguments;
@@ -358,6 +362,8 @@ export module DebugProtocol {
358362
export interface StepInArguments {
359363
/** Continue execution for this thread. */
360364
threadId: number;
365+
/** Optional id of the target to step into. */
366+
targetId?: number | string;
361367
}
362368
/** Response to "stepIn" request. This is just an acknowledgement, so no body field is required. */
363369
export interface StepInResponse extends Response {
@@ -599,6 +605,31 @@ export module DebugProtocol {
599605
};
600606
}
601607

608+
/** StepInTargets request; value of command field is "stepInTargets".
609+
This request retrieves the possible stepIn targets for the specified source location.
610+
These targets can be used in the "stepIn" request.
611+
The StepInTargets may only be called if the "supportsStepInTargetsRequest" capability exists and is true.
612+
*/
613+
export interface StepInTargetsRequest extends Request {
614+
arguments: StepInTargetsArguments;
615+
}
616+
/** Arguments for "stepInTargets" request. */
617+
export interface StepInTargetsArguments {
618+
/** The source of the source location. */
619+
source: Source;
620+
/** The line of the source location. */
621+
line: number;
622+
/** An optional column of the source location. */
623+
column?: number;
624+
}
625+
/** Response to "stepInTargets" request. */
626+
export interface StepInTargetsResponse extends Response {
627+
body: {
628+
/** The possible stepIn targets of the specified source location. */
629+
targets: StepInTarget[];
630+
};
631+
}
632+
602633
//---- Types
603634

604635
/** Information about the capabilities of a debug adapter. */
@@ -619,6 +650,8 @@ export module DebugProtocol {
619650
supportsSetVariable?: boolean;
620651
/** The debug adapter supports restarting a frame. */
621652
supportsRestartFrame?: boolean;
653+
/** The debug adapter supports stepInTargetsRequest. */
654+
supportsStepInTargetsRequest?: boolean;
622655
}
623656

624657
/** An ExceptionBreakpointsFilter is shown in the UI as an option for configuring how exceptions are dealt with. */
@@ -818,4 +851,14 @@ export module DebugProtocol {
818851
/** An optional end column of the actual range covered by the breakpoint. If no end line is given, then the end column is assumed to be in the start line. */
819852
endColumn?: number;
820853
}
854+
855+
/** A StepInTarget can be used in the 'stepIn' request and determines into
856+
* which single target the stepIn request should step.
857+
*/
858+
export interface StepInTarget {
859+
/** Unique identifier for a stepIn target. */
860+
id: number | string;
861+
/** The name of the stepIn target (shown in the UI). */
862+
label: string;
863+
}
821864
}

0 commit comments

Comments
 (0)