Skip to content

Commit 06f5756

Browse files
committed
More comment cleanup. Sigh... Also renamed SetFunctionBreakpoints to SetCommandBreakpoints. This is a "PowerShell" service and as such its API should be "PowerShell" oriented.
1 parent f6ccf07 commit 06f5756

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

src/PowerShellEditorServices.Protocol/Server/DebugAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ protected async Task HandleSetFunctionBreakpointsRequest(
231231
}
232232

233233
FunctionBreakpointDetails[] breakpoints =
234-
await editorSession.DebugService.SetFunctionBreakpoints(
234+
await editorSession.DebugService.SetCommandBreakpoints(
235235
breakpointDetails);
236236

237237
await requestContext.SendResult(

src/PowerShellEditorServices/Debugging/DebugService.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ public async Task<BreakpointDetails[]> SetLineBreakpoints(
119119
IEnumerable<Breakpoint> configuredBreakpoints =
120120
await this.powerShellContext.ExecuteCommand<Breakpoint>(psCommand);
121121

122+
// The order in which the breakpoints are returned is significant to the
123+
// VSCode client and should match the order in which they are passed in.
122124
resultBreakpointDetails.AddRange(
123125
configuredBreakpoints.Select(BreakpointDetails.Create));
124126
}
@@ -128,12 +130,12 @@ public async Task<BreakpointDetails[]> SetLineBreakpoints(
128130
}
129131

130132
/// <summary>
131-
/// Sets the list of line breakpoints for the current debugging session.
133+
/// Sets the list of command breakpoints for the current debugging session.
132134
/// </summary>
133-
/// <param name="breakpoints">BreakpointDetails for each breakpoint that will be set.</param>
134-
/// <param name="clearExisting">If true, causes all existing breakpoints to be cleared before setting new ones.</param>
135+
/// <param name="breakpoints">BreakpointDetails for each command breakpoint that will be set.</param>
136+
/// <param name="clearExisting">If true, causes all existing function breakpoints to be cleared before setting new ones.</param>
135137
/// <returns>An awaitable Task that will provide details about the breakpoints that were set.</returns>
136-
public async Task<FunctionBreakpointDetails[]> SetFunctionBreakpoints(
138+
public async Task<FunctionBreakpointDetails[]> SetCommandBreakpoints(
137139
FunctionBreakpointDetails[] breakpoints,
138140
bool clearExisting = true)
139141
{
@@ -171,6 +173,8 @@ public async Task<FunctionBreakpointDetails[]> SetFunctionBreakpoints(
171173
IEnumerable<Breakpoint> configuredBreakpoints =
172174
await this.powerShellContext.ExecuteCommand<Breakpoint>(psCommand);
173175

176+
// The order in which the breakpoints are returned is significant to the
177+
// VSCode client and should match the order in which they are passed in.
174178
resultBreakpointDetails.AddRange(
175179
configuredBreakpoints.Select(FunctionBreakpointDetails.Create));
176180
}

test/PowerShellEditorServices.Test/Debugging/DebugServiceTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ await this.debugService.SetLineBreakpoints(
151151
public async Task DebuggerSetsAndClearsFunctionBreakpoints()
152152
{
153153
FunctionBreakpointDetails[] breakpoints =
154-
await this.debugService.SetFunctionBreakpoints(
154+
await this.debugService.SetCommandBreakpoints(
155155
new[] {
156156
FunctionBreakpointDetails.Create("Write-Host"),
157157
FunctionBreakpointDetails.Create("Get-Date")
@@ -162,14 +162,14 @@ await this.debugService.SetFunctionBreakpoints(
162162
Assert.Equal("Get-Date", breakpoints[1].Name);
163163

164164
breakpoints =
165-
await this.debugService.SetFunctionBreakpoints(
165+
await this.debugService.SetCommandBreakpoints(
166166
new[] { FunctionBreakpointDetails.Create("Get-Host") });
167167

168168
Assert.Equal(1, breakpoints.Length);
169169
Assert.Equal("Get-Host", breakpoints[0].Name);
170170

171171
breakpoints =
172-
await this.debugService.SetFunctionBreakpoints(
172+
await this.debugService.SetCommandBreakpoints(
173173
new FunctionBreakpointDetails[] {});
174174

175175
Assert.Equal(0, breakpoints.Length);
@@ -179,7 +179,7 @@ await this.debugService.SetFunctionBreakpoints(
179179
public async Task DebuggerStopsOnFunctionBreakpoints()
180180
{
181181
FunctionBreakpointDetails[] breakpoints =
182-
await this.debugService.SetFunctionBreakpoints(
182+
await this.debugService.SetCommandBreakpoints(
183183
new[] {
184184
FunctionBreakpointDetails.Create("Write-Host")
185185
});

0 commit comments

Comments
 (0)