@@ -39,7 +39,7 @@ public async Task InitializeAsync()
39
39
{
40
40
LoggerFactory factory = new ( ) ;
41
41
_psesProcess = new PsesStdioProcess ( factory , true ) ;
42
- await _psesProcess . Start ( ) . ConfigureAwait ( true ) ;
42
+ await _psesProcess . Start ( ) ;
43
43
44
44
TaskCompletionSource < bool > initialized = new ( ) ;
45
45
@@ -91,9 +91,9 @@ public async Task InitializeAsync()
91
91
// This tells us that we are ready to send messages to PSES... but are not stuck waiting for
92
92
// Initialized.
93
93
#pragma warning disable CS4014
94
- PsesDebugAdapterClient . Initialize ( CancellationToken . None ) . ConfigureAwait ( true ) ;
94
+ PsesDebugAdapterClient . Initialize ( CancellationToken . None ) ;
95
95
#pragma warning restore CS4014
96
- await initialized . Task . ConfigureAwait ( true ) ;
96
+ await initialized . Task ;
97
97
}
98
98
99
99
public async Task DisposeAsync ( )
@@ -102,8 +102,8 @@ await PsesDebugAdapterClient.RequestDisconnect(new DisconnectArguments
102
102
{
103
103
Restart = false ,
104
104
TerminateDebuggee = true
105
- } ) . ConfigureAwait ( true ) ;
106
- await _psesProcess . Stop ( ) . ConfigureAwait ( true ) ;
105
+ } ) ;
106
+ await _psesProcess . Stop ( ) ;
107
107
}
108
108
109
109
public void Dispose ( )
@@ -164,10 +164,10 @@ private static async Task<string[]> GetLog()
164
164
{
165
165
for ( int i = 0 ; ! File . Exists ( s_testOutputPath ) && i < 60 ; i ++ )
166
166
{
167
- await Task . Delay ( 1000 ) . ConfigureAwait ( true ) ;
167
+ await Task . Delay ( 1000 ) ;
168
168
}
169
169
// Sleep one more time after the file exists so whatever is writing can finish.
170
- await Task . Delay ( 1000 ) . ConfigureAwait ( true ) ;
170
+ await Task . Delay ( 1000 ) ;
171
171
return File . ReadLines ( s_testOutputPath ) . ToArray ( ) ;
172
172
}
173
173
@@ -186,10 +186,10 @@ public void CanInitializeWithCorrectServerSettings()
186
186
public async Task UsesDotSourceOperatorAndQuotesAsync ( )
187
187
{
188
188
string filePath = NewTestFile ( GenerateScriptFromLoggingStatements ( "$($MyInvocation.Line)" ) ) ;
189
- await PsesDebugAdapterClient . LaunchScript ( filePath , Started ) . ConfigureAwait ( true ) ;
190
- ConfigurationDoneResponse configDoneResponse = await PsesDebugAdapterClient . RequestConfigurationDone ( new ConfigurationDoneArguments ( ) ) . ConfigureAwait ( true ) ;
189
+ await PsesDebugAdapterClient . LaunchScript ( filePath , Started ) ;
190
+ ConfigurationDoneResponse configDoneResponse = await PsesDebugAdapterClient . RequestConfigurationDone ( new ConfigurationDoneArguments ( ) ) ;
191
191
Assert . NotNull ( configDoneResponse ) ;
192
- Assert . Collection ( await GetLog ( ) . ConfigureAwait ( true ) ,
192
+ Assert . Collection ( await GetLog ( ) ,
193
193
( i ) => Assert . StartsWith ( ". '" , i ) ) ;
194
194
}
195
195
@@ -198,11 +198,11 @@ public async Task CanLaunchScriptWithNoBreakpointsAsync()
198
198
{
199
199
string filePath = NewTestFile ( GenerateScriptFromLoggingStatements ( "works" ) ) ;
200
200
201
- await PsesDebugAdapterClient . LaunchScript ( filePath , Started ) . ConfigureAwait ( true ) ;
201
+ await PsesDebugAdapterClient . LaunchScript ( filePath , Started ) ;
202
202
203
- ConfigurationDoneResponse configDoneResponse = await PsesDebugAdapterClient . RequestConfigurationDone ( new ConfigurationDoneArguments ( ) ) . ConfigureAwait ( true ) ;
203
+ ConfigurationDoneResponse configDoneResponse = await PsesDebugAdapterClient . RequestConfigurationDone ( new ConfigurationDoneArguments ( ) ) ;
204
204
Assert . NotNull ( configDoneResponse ) ;
205
- Assert . Collection ( await GetLog ( ) . ConfigureAwait ( true ) ,
205
+ Assert . Collection ( await GetLog ( ) ,
206
206
( i ) => Assert . Equal ( "works" , i ) ) ;
207
207
}
208
208
@@ -218,32 +218,32 @@ public async Task CanSetBreakpointsAsync()
218
218
"after breakpoint"
219
219
) ) ;
220
220
221
- await PsesDebugAdapterClient . LaunchScript ( filePath , Started ) . ConfigureAwait ( true ) ;
221
+ await PsesDebugAdapterClient . LaunchScript ( filePath , Started ) ;
222
222
223
223
// {"command":"setBreakpoints","arguments":{"source":{"name":"dfsdfg.ps1","path":"/Users/tyleonha/Code/PowerShell/Misc/foo/dfsdfg.ps1"},"lines":[2],"breakpoints":[{"line":2}],"sourceModified":false},"type":"request","seq":3}
224
224
SetBreakpointsResponse setBreakpointsResponse = await PsesDebugAdapterClient . SetBreakpoints ( new SetBreakpointsArguments
225
225
{
226
226
Source = new Source { Name = Path . GetFileName ( filePath ) , Path = filePath } ,
227
227
Breakpoints = new SourceBreakpoint [ ] { new SourceBreakpoint { Line = 2 } } ,
228
228
SourceModified = false ,
229
- } ) . ConfigureAwait ( true ) ;
229
+ } ) ;
230
230
231
231
Breakpoint breakpoint = setBreakpointsResponse . Breakpoints . First ( ) ;
232
232
Assert . True ( breakpoint . Verified ) ;
233
233
Assert . Equal ( filePath , breakpoint . Source . Path , ignoreCase : s_isWindows ) ;
234
234
Assert . Equal ( 2 , breakpoint . Line ) ;
235
235
236
- ConfigurationDoneResponse configDoneResponse = await PsesDebugAdapterClient . RequestConfigurationDone ( new ConfigurationDoneArguments ( ) ) . ConfigureAwait ( true ) ;
236
+ ConfigurationDoneResponse configDoneResponse = await PsesDebugAdapterClient . RequestConfigurationDone ( new ConfigurationDoneArguments ( ) ) ;
237
237
Assert . NotNull ( configDoneResponse ) ;
238
- Assert . Collection ( await GetLog ( ) . ConfigureAwait ( true ) ,
238
+ Assert . Collection ( await GetLog ( ) ,
239
239
( i ) => Assert . Equal ( "before breakpoint" , i ) ) ;
240
240
File . Delete ( s_testOutputPath ) ;
241
241
242
242
ContinueResponse continueResponse = await PsesDebugAdapterClient . RequestContinue (
243
- new ContinueArguments { ThreadId = 1 } ) . ConfigureAwait ( true ) ;
243
+ new ContinueArguments { ThreadId = 1 } ) ;
244
244
245
245
Assert . NotNull ( continueResponse ) ;
246
- Assert . Collection ( await GetLog ( ) . ConfigureAwait ( true ) ,
246
+ Assert . Collection ( await GetLog ( ) ,
247
247
( i ) => Assert . Equal ( "at breakpoint" , i ) ,
248
248
( i ) => Assert . Equal ( "after breakpoint" , i ) ) ;
249
249
}
@@ -274,24 +274,24 @@ public async Task CanStepPastSystemWindowsForms()
274
274
"Write-Host $form"
275
275
} ) ) ;
276
276
277
- await PsesDebugAdapterClient . LaunchScript ( filePath , Started ) . ConfigureAwait ( true ) ;
277
+ await PsesDebugAdapterClient . LaunchScript ( filePath , Started ) ;
278
278
279
279
SetFunctionBreakpointsResponse setBreakpointsResponse = await PsesDebugAdapterClient . SetFunctionBreakpoints (
280
280
new SetFunctionBreakpointsArguments
281
281
{
282
282
Breakpoints = new FunctionBreakpoint [ ]
283
283
{ new FunctionBreakpoint { Name = "Write-Host" , } }
284
- } ) . ConfigureAwait ( true ) ;
284
+ } ) ;
285
285
286
286
Breakpoint breakpoint = setBreakpointsResponse . Breakpoints . First ( ) ;
287
287
Assert . True ( breakpoint . Verified ) ;
288
288
289
- ConfigurationDoneResponse configDoneResponse = await PsesDebugAdapterClient . RequestConfigurationDone ( new ConfigurationDoneArguments ( ) ) . ConfigureAwait ( true ) ;
289
+ ConfigurationDoneResponse configDoneResponse = await PsesDebugAdapterClient . RequestConfigurationDone ( new ConfigurationDoneArguments ( ) ) ;
290
290
Assert . NotNull ( configDoneResponse ) ;
291
- await Task . Delay ( 5000 ) . ConfigureAwait ( true ) ;
291
+ await Task . Delay ( 5000 ) ;
292
292
293
293
VariablesResponse variablesResponse = await PsesDebugAdapterClient . RequestVariables (
294
- new VariablesArguments { VariablesReference = 1 } ) . ConfigureAwait ( true ) ;
294
+ new VariablesArguments { VariablesReference = 1 } ) ;
295
295
296
296
Variable form = variablesResponse . Variables . FirstOrDefault ( v => v . Name == "$form" ) ;
297
297
Assert . NotNull ( form ) ;
@@ -312,15 +312,15 @@ public async Task CanLaunchScriptWithCommentedLastLineAsync()
312
312
// PsesLaunchRequestArguments.Script, which is then assigned to
313
313
// DebugStateService.ScriptToLaunch in that handler, and finally used by the
314
314
// ConfigurationDoneHandler in LaunchScriptAsync.
315
- await PsesDebugAdapterClient . LaunchScript ( script , Started ) . ConfigureAwait ( true ) ;
315
+ await PsesDebugAdapterClient . LaunchScript ( script , Started ) ;
316
316
317
- ConfigurationDoneResponse configDoneResponse = await PsesDebugAdapterClient . RequestConfigurationDone ( new ConfigurationDoneArguments ( ) ) . ConfigureAwait ( true ) ;
317
+ ConfigurationDoneResponse configDoneResponse = await PsesDebugAdapterClient . RequestConfigurationDone ( new ConfigurationDoneArguments ( ) ) ;
318
318
Assert . NotNull ( configDoneResponse ) ;
319
319
// We can check that the script was invoked as expected, which is to dot-source a script
320
320
// block with the contents surrounded by newlines. While we can't check that the last
321
321
// line was a curly brace by itself, we did check that the contents ended with a
322
322
// comment, so if this output exists then the bug did not recur.
323
- Assert . Collection ( await GetLog ( ) . ConfigureAwait ( true ) ,
323
+ Assert . Collection ( await GetLog ( ) ,
324
324
( i ) => Assert . Equal ( ". {" , i ) ,
325
325
( i ) => Assert . Equal ( "" , i ) ) ;
326
326
}
@@ -342,9 +342,9 @@ public async Task CanRunPesterTestFile()
342
342
using CancellationTokenSource cts = new(5000);
343
343
while (!File.Exists(pesterLog) && !cts.Token.IsCancellationRequested)
344
344
{
345
- await Task.Delay(1000).ConfigureAwait(true) ;
345
+ await Task.Delay(1000);
346
346
}
347
- await Task.Delay(15000).ConfigureAwait(true) ;
347
+ await Task.Delay(15000);
348
348
_output.WriteLine(File.ReadAllText(pesterLog));
349
349
*/
350
350
@@ -360,9 +360,9 @@ public async Task CanRunPesterTestFile()
360
360
}
361
361
}" , isPester : true ) ;
362
362
363
- await PsesDebugAdapterClient . LaunchScript ( $ "Invoke-Pester -Script '{ pesterTest } '", Started ) . ConfigureAwait ( true ) ;
364
- await PsesDebugAdapterClient . RequestConfigurationDone ( new ConfigurationDoneArguments ( ) ) . ConfigureAwait ( true ) ;
365
- Assert . Collection ( await GetLog ( ) . ConfigureAwait ( true ) , ( i ) => Assert . Equal ( "pester" , i ) ) ;
363
+ await PsesDebugAdapterClient . LaunchScript ( $ "Invoke-Pester -Script '{ pesterTest } '", Started ) ;
364
+ await PsesDebugAdapterClient . RequestConfigurationDone ( new ConfigurationDoneArguments ( ) ) ;
365
+ Assert . Collection ( await GetLog ( ) , ( i ) => Assert . Equal ( "pester" , i ) ) ;
366
366
}
367
367
}
368
368
}
0 commit comments