@@ -158,7 +158,10 @@ await debugService.SetCommandBreakpointsAsync(
158
158
159
159
StackFrameDetails [ ] stackFrames = await debugService . GetStackFramesAsync ( ) . ConfigureAwait ( true ) ;
160
160
Assert . Equal ( StackFrameDetails . NoFileScriptPath , stackFrames [ 0 ] . ScriptPath ) ;
161
- VariableDetailsBase [ ] variables = debugService . GetVariables ( debugService . globalScopeVariables . Id ) ;
161
+
162
+ VariableScope [ ] scopes = debugService . GetVariableScopes ( 0 ) ;
163
+ VariableScope globalScope = Array . Find ( scopes , s => s . Name == VariableContainerDetails . GlobalScopeName ) ;
164
+ VariableDetailsBase [ ] variables = debugService . GetVariables ( globalScope . Id ) ;
162
165
163
166
// NOTE: This assertion will fail if any error occurs. Notably this happens in testing
164
167
// when the assembly path changes and the commands definition file can't be found.
@@ -197,8 +200,9 @@ public async Task DebuggerAcceptsScriptArgs()
197
200
198
201
AssertDebuggerStopped ( debugWithParamsFile . FilePath , 3 ) ;
199
202
200
- StackFrameDetails [ ] stackFrames = await debugService . GetStackFramesAsync ( ) . ConfigureAwait ( true ) ;
201
- VariableDetailsBase [ ] variables = debugService . GetVariables ( stackFrames [ 0 ] . AutoVariables . Id ) ;
203
+ VariableScope [ ] scopes = debugService . GetVariableScopes ( 0 ) ;
204
+ VariableScope localScope = Array . Find ( scopes , s => s . Name == VariableContainerDetails . LocalScopeName ) ;
205
+ VariableDetailsBase [ ] variables = debugService . GetVariables ( localScope . Id ) ;
202
206
203
207
var var = Array . Find ( variables , v => v . Name == "$Param1" ) ;
204
208
Assert . NotNull ( var ) ;
@@ -220,6 +224,7 @@ public async Task DebuggerAcceptsScriptArgs()
220
224
Assert . True ( var . IsExpandable ) ;
221
225
222
226
// NOTE: $args are no longer found in AutoVariables but CommandVariables instead.
227
+ StackFrameDetails [ ] stackFrames = await debugService . GetStackFramesAsync ( ) . ConfigureAwait ( true ) ;
223
228
variables = debugService . GetVariables ( stackFrames [ 0 ] . CommandVariables . Id ) ;
224
229
var = Array . Find ( variables , v => v . Name == "$args" ) ;
225
230
Assert . NotNull ( var ) ;
@@ -618,9 +623,8 @@ await debugService.SetLineBreakpointsAsync(
618
623
debugService . StepOver ( ) ;
619
624
AssertDebuggerStopped ( variableScriptFile . FilePath ) ;
620
625
621
- stackFrames = await debugService . GetStackFramesAsync ( ) . ConfigureAwait ( true ) ;
622
-
623
626
// Test set of a local string variable (not strongly typed)
627
+ stackFrames = await debugService . GetStackFramesAsync ( ) . ConfigureAwait ( true ) ;
624
628
variables = debugService . GetVariables ( stackFrames [ 0 ] . AutoVariables . Id ) ;
625
629
var strVar = Array . Find ( variables , v => v . Name == "$strVar" ) ;
626
630
Assert . Equal ( newStrValue , strVar . ValueString ) ;
@@ -682,9 +686,8 @@ await debugService.SetLineBreakpointsAsync(
682
686
debugService . StepOver ( ) ;
683
687
AssertDebuggerStopped ( variableScriptFile . FilePath ) ;
684
688
685
- stackFrames = await debugService . GetStackFramesAsync ( ) . ConfigureAwait ( true ) ;
686
-
687
689
// Test set of a local string variable (not strongly typed but force conversion)
690
+ stackFrames = await debugService . GetStackFramesAsync ( ) . ConfigureAwait ( true ) ;
688
691
variables = debugService . GetVariables ( stackFrames [ 0 ] . AutoVariables . Id ) ;
689
692
var strVar = Array . Find ( variables , v => v . Name == "$strVar2" ) ;
690
693
Assert . Equal ( newStrValue , strVar . ValueString ) ;
0 commit comments