File tree 8 files changed +29
-6
lines changed
PowerShellEditorServices/Debugging
PowerShellEditorServices.Protocol
8 files changed +29
-6
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ public class InitializeResponseBody
47
47
/// </summary>
48
48
public bool SupportsConditionalBreakpoints { get ; set ; }
49
49
50
+ /// <summary>
51
+ /// Gets or sets a boolean value that determines whether the debug adapter
52
+ /// supports breakpoints that break execution after a specified number of hits.
53
+ /// </summary>
54
+ public bool SupportsHitConditionalBreakpoints { get ; set ; }
55
+
50
56
/// <summary>
51
57
/// Gets or sets a boolean value that determines whether the debug adapter
52
58
/// supports a (side effect free) evaluate request for data hovers.
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ public class SourceBreakpoint
34
34
public int ? Column { get ; set ; }
35
35
36
36
public string Condition { get ; set ; }
37
+
38
+ public string HitCondition { get ; set ; }
37
39
}
38
40
39
41
public class SetBreakpointsResponseBody
Original file line number Diff line number Diff line change @@ -27,5 +27,7 @@ public class FunctionBreakpoint
27
27
public string Name { get ; set ; }
28
28
29
29
public string Condition { get ; set ; }
30
+
31
+ public string HitCondition { get ; set ; }
30
32
}
31
33
}
Original file line number Diff line number Diff line change @@ -262,7 +262,8 @@ await requestContext.SendResult(
262
262
scriptFile . FilePath ,
263
263
srcBreakpoint . Line ,
264
264
srcBreakpoint . Column ,
265
- srcBreakpoint . Condition ) ;
265
+ srcBreakpoint . Condition ,
266
+ srcBreakpoint . HitCondition ) ;
266
267
}
267
268
268
269
// If this is a "run without debugging (Ctrl+F5)" session ignore requests to set breakpoints.
@@ -294,7 +295,8 @@ protected async Task HandleSetFunctionBreakpointsRequest(
294
295
FunctionBreakpoint funcBreakpoint = setBreakpointsParams . Breakpoints [ i ] ;
295
296
breakpointDetails [ i ] = CommandBreakpointDetails . Create (
296
297
funcBreakpoint . Name ,
297
- funcBreakpoint . Condition ) ;
298
+ funcBreakpoint . Condition ,
299
+ funcBreakpoint . HitCondition ) ;
298
300
}
299
301
300
302
// If this is a "run without debugging (Ctrl+F5)" session ignore requests to set breakpoints.
Original file line number Diff line number Diff line change @@ -58,8 +58,9 @@ private async Task HandleInitializeRequest(
58
58
await requestContext . SendResult (
59
59
new InitializeResponseBody {
60
60
SupportsConfigurationDoneRequest = true ,
61
- SupportsConditionalBreakpoints = true ,
62
61
SupportsFunctionBreakpoints = true ,
62
+ SupportsConditionalBreakpoints = true ,
63
+ SupportsHitConditionalBreakpoints = true ,
63
64
SupportsSetVariable = true
64
65
} ) ;
65
66
Original file line number Diff line number Diff line change @@ -42,12 +42,14 @@ private BreakpointDetails()
42
42
/// <param name="line"></param>
43
43
/// <param name="column"></param>
44
44
/// <param name="condition"></param>
45
+ /// <param name="hitCondition"></param>
45
46
/// <returns></returns>
46
47
public static BreakpointDetails Create (
47
48
string source ,
48
49
int line ,
49
50
int ? column = null ,
50
- string condition = null )
51
+ string condition = null ,
52
+ string hitCondition = null )
51
53
{
52
54
Validate . IsNotNull ( "source" , source ) ;
53
55
@@ -57,7 +59,8 @@ public static BreakpointDetails Create(
57
59
Source = source ,
58
60
LineNumber = line ,
59
61
ColumnNumber = column ,
60
- Condition = condition
62
+ Condition = condition ,
63
+ HitCondition = hitCondition
61
64
} ;
62
65
}
63
66
Original file line number Diff line number Diff line change @@ -27,5 +27,10 @@ public abstract class BreakpointDetailsBase
27
27
/// Gets the breakpoint condition string.
28
28
/// </summary>
29
29
public string Condition { get ; protected set ; }
30
+
31
+ /// <summary>
32
+ /// Gets the breakpoint hit condition string.
33
+ /// </summary>
34
+ public string HitCondition { get ; protected set ; }
30
35
}
31
36
}
Original file line number Diff line number Diff line change @@ -29,10 +29,12 @@ private CommandBreakpointDetails()
29
29
/// </summary>
30
30
/// <param name="name">The name of the command to break on.</param>
31
31
/// <param name="condition">Condition string that would be applied to the breakpoint Action parameter.</param>
32
+ /// <param name="hitCondition">Hit condition string that would be applied to the breakpoint Action parameter.</param>
32
33
/// <returns></returns>
33
34
public static CommandBreakpointDetails Create (
34
35
string name ,
35
- string condition = null )
36
+ string condition = null ,
37
+ string hitCondition = null )
36
38
{
37
39
Validate . IsNotNull ( nameof ( name ) , name ) ;
38
40
You can’t perform that action at this time.
0 commit comments