@@ -83,34 +83,7 @@ public async Task<BreakpointDetails[]> SetLineBreakpoints(
83
83
string escapedScriptPath =
84
84
PowerShellContext . EscapePath ( scriptFile . FilePath , escapeSpaces : false ) ;
85
85
86
- // Line breakpoints with no condition and no column number are the most common,
87
- // so let's optimize for that case by making a single call to Set-PSBreakpoint
88
- // with all the lines to set a breakpoint on.
89
- int [ ] lineOnlyBreakpoints =
90
- breakpoints . Where ( b => ( b . ColumnNumber == null ) && ( b . Condition == null ) )
91
- . Select ( b => b . LineNumber )
92
- . ToArray ( ) ;
93
-
94
- if ( lineOnlyBreakpoints . Length > 0 )
95
- {
96
- PSCommand psCommand = new PSCommand ( ) ;
97
- psCommand . AddCommand ( "Set-PSBreakpoint" ) ;
98
- psCommand . AddParameter ( "Script" , escapedScriptPath ) ;
99
- psCommand . AddParameter ( "Line" , lineOnlyBreakpoints ) ;
100
-
101
- var configuredBreakpoints =
102
- await this . powerShellContext . ExecuteCommand < Breakpoint > ( psCommand ) ;
103
-
104
- resultBreakpointDetails . AddRange (
105
- configuredBreakpoints . Select ( BreakpointDetails . Create ) ) ;
106
- }
107
-
108
- // Process the rest of the breakpoints
109
- var advancedLineBreakpoints =
110
- breakpoints . Where ( b => ( b . ColumnNumber != null ) || ( b . Condition != null ) )
111
- . ToArray ( ) ;
112
-
113
- foreach ( BreakpointDetails breakpoint in advancedLineBreakpoints )
86
+ foreach ( BreakpointDetails breakpoint in breakpoints )
114
87
{
115
88
PSCommand psCommand = new PSCommand ( ) ;
116
89
psCommand . AddCommand ( "Set-PSBreakpoint" ) ;
@@ -174,33 +147,7 @@ public async Task<FunctionBreakpointDetails[]> SetFunctionBreakpoints(
174
147
175
148
if ( breakpoints . Length > 0 )
176
149
{
177
- // Line function breakpoints with no condition are the most common,
178
- // so let's optimize for that case by making a single call to Set-PSBreakpoint
179
- // with all the command names to set a breakpoint on.
180
- string [ ] commandOnlyBreakpoints =
181
- breakpoints . Where ( b => ( b . Condition == null ) )
182
- . Select ( b => b . Name )
183
- . ToArray ( ) ;
184
-
185
- if ( commandOnlyBreakpoints . Length > 0 )
186
- {
187
- PSCommand psCommand = new PSCommand ( ) ;
188
- psCommand . AddCommand ( @"Microsoft.PowerShell.Utility\Set-PSBreakpoint" ) ;
189
- psCommand . AddParameter ( "Command" , commandOnlyBreakpoints ) ;
190
-
191
- var configuredBreakpoints =
192
- await this . powerShellContext . ExecuteCommand < Breakpoint > ( psCommand ) ;
193
-
194
- resultBreakpointDetails . AddRange (
195
- configuredBreakpoints . Select ( FunctionBreakpointDetails . Create ) ) ;
196
- }
197
-
198
- // Process the rest of the breakpoints
199
- var advancedCommandBreakpoints =
200
- breakpoints . Where ( b => ( b . Condition != null ) )
201
- . ToArray ( ) ;
202
-
203
- foreach ( FunctionBreakpointDetails breakpoint in advancedCommandBreakpoints )
150
+ foreach ( FunctionBreakpointDetails breakpoint in breakpoints )
204
151
{
205
152
PSCommand psCommand = new PSCommand ( ) ;
206
153
psCommand . AddCommand ( @"Microsoft.PowerShell.Utility\Set-PSBreakpoint" ) ;
0 commit comments