Skip to content

Commit 730ca08

Browse files
committed
WIP: Further
1 parent 44b4a46 commit 730ca08

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/PowerShellEditorServices/Services/DebugAdapter/DebugService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ internal class DebugService
4545
private int nextVariableId;
4646
private string temporaryScriptListingPath;
4747
private List<VariableDetailsBase> variables;
48-
private VariableContainerDetails globalScopeVariables;
48+
internal VariableContainerDetails globalScopeVariables;
4949
private VariableContainerDetails scriptScopeVariables;
5050
private VariableContainerDetails localScopeVariables;
5151
private StackFrameDetails[] stackFrameDetails;

test/PowerShellEditorServices.Test/Debugging/DebugServiceTests.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,20 @@ await debugService.SetCommandBreakpointsAsync(
9595
new[] { CommandBreakpointDetails.Create("Get-Random") }).ConfigureAwait(false);
9696

9797
Task executeTask = _psesHost.ExecutePSCommandAsync(
98-
new PSCommand().AddCommand("Get-Random").AddParameter("Maximum", 100), CancellationToken.None);
98+
new PSCommand().AddCommand("Get-Random").AddParameter("Maximum", 100),
99+
CancellationToken.None,
100+
// new PowerShellExecutionOptions { MustRunInForeground = true, ThrowOnError = false }
101+
);
99102

100103
AssertDebuggerStopped("", 1);
101104
debugService.Continue();
102-
await executeTask.ConfigureAwait(false);
105+
// await executeTask.ConfigureAwait(false);
103106

104107
StackFrameDetails[] stackFrames = await debugService.GetStackFramesAsync().ConfigureAwait(false);
105108
Assert.Equal(StackFrameDetails.NoFileScriptPath, stackFrames[0].ScriptPath);
106109

107110
VariableDetailsBase[] variables =
108-
debugService.GetVariables(stackFrames[0].AutoVariables.Id);
111+
debugService.GetVariables(debugService.globalScopeVariables.Id);
109112

110113
var var = variables.FirstOrDefault(v => v.Name == "$Error");
111114
Assert.NotNull(var);

0 commit comments

Comments
 (0)