Skip to content

Commit 4d147fc

Browse files
authored
Merge pull request #44 from Microsoft/weinand/step-into-specific
Proposed protocol addition "step-into-specifc" #39
2 parents ae4c0ce + 2c2fe74 commit 4d147fc

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
@@ -362,8 +362,12 @@ export module DebugProtocol {
362362
}
363363

364364
/** StepIn request; value of command field is "stepIn".
365-
The request starts the debuggee to run again for one step.
365+
The request starts the debuggee to step into a function/method if possible.
366+
If it cannot step into a target, "stepIn" behaves like "next".
366367
The debug adapter first sends the StepInResponse and then a StoppedEvent (event type 'step') after the step has completed.
368+
If there are multiple function/method calls (or other targets) on the source line,
369+
the optional argument 'targetId' can be used to control into which target the "stepIn" should occur.
370+
The list of possible targets for a given source line can be retrieved via the "stepInTargets" request.
367371
*/
368372
export interface StepInRequest extends Request {
369373
arguments: StepInArguments;
@@ -372,6 +376,8 @@ export module DebugProtocol {
372376
export interface StepInArguments {
373377
/** Continue execution for this thread. */
374378
threadId: number;
379+
/** Optional id of the target to step into. */
380+
targetId?: number | string;
375381
}
376382
/** Response to "stepIn" request. This is just an acknowledgement, so no body field is required. */
377383
export interface StepInResponse extends Response {
@@ -613,6 +619,31 @@ export module DebugProtocol {
613619
};
614620
}
615621

622+
/** StepInTargets request; value of command field is "stepInTargets".
623+
This request retrieves the possible stepIn targets for the specified source location.
624+
These targets can be used in the "stepIn" request.
625+
The StepInTargets may only be called if the "supportsStepInTargetsRequest" capability exists and is true.
626+
*/
627+
export interface StepInTargetsRequest extends Request {
628+
arguments: StepInTargetsArguments;
629+
}
630+
/** Arguments for "stepInTargets" request. */
631+
export interface StepInTargetsArguments {
632+
/** The source of the source location. */
633+
source: Source;
634+
/** The line of the source location. */
635+
line: number;
636+
/** An optional column of the source location. */
637+
column?: number;
638+
}
639+
/** Response to "stepInTargets" request. */
640+
export interface StepInTargetsResponse extends Response {
641+
body: {
642+
/** The possible stepIn targets of the specified source location. */
643+
targets: StepInTarget[];
644+
};
645+
}
646+
616647
//---- Types
617648

618649
/** Information about the capabilities of a debug adapter. */
@@ -633,6 +664,8 @@ export module DebugProtocol {
633664
supportsSetVariable?: boolean;
634665
/** The debug adapter supports restarting a frame. */
635666
supportsRestartFrame?: boolean;
667+
/** The debug adapter supports stepInTargetsRequest. */
668+
supportsStepInTargetsRequest?: boolean;
636669
}
637670

638671
/** An ExceptionBreakpointsFilter is shown in the UI as an option for configuring how exceptions are dealt with. */
@@ -832,4 +865,14 @@ export module DebugProtocol {
832865
/** 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. */
833866
endColumn?: number;
834867
}
868+
869+
/** A StepInTarget can be used in the 'stepIn' request and determines into
870+
* which single target the stepIn request should step.
871+
*/
872+
export interface StepInTarget {
873+
/** Unique identifier for a stepIn target. */
874+
id: number | string;
875+
/** The name of the stepIn target (shown in the UI). */
876+
label: string;
877+
}
835878
}

0 commit comments

Comments
 (0)