From 0b3efde3bac44554eae58041846b83a7ca0fa537 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 19 Apr 2022 13:21:48 -0700 Subject: [PATCH] Temporarily disable `IsDebuggerCommand` check And instead run any commands while debugging through `ExecuteInDebugger`. This means the history will be polluted, but since this fix isn't working 100%, we're not shipping it yet. --- .../PowerShell/Execution/SynchronousPowerShellTask.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PowerShellEditorServices/Services/PowerShell/Execution/SynchronousPowerShellTask.cs b/src/PowerShellEditorServices/Services/PowerShell/Execution/SynchronousPowerShellTask.cs index 71accf212..a9b09111c 100644 --- a/src/PowerShellEditorServices/Services/PowerShell/Execution/SynchronousPowerShellTask.cs +++ b/src/PowerShellEditorServices/Services/PowerShell/Execution/SynchronousPowerShellTask.cs @@ -50,7 +50,7 @@ public SynchronousPowerShellTask( // These are PowerShell's intrinsic debugger commands that must be run via // `ProcessDebugCommand`. - private static readonly string[] DebuggerCommands = { "continue", "c", "k", "h", "?", "list", "l", "stepInto", "s", "stepOut", "o", "stepOver", "v", "quit", "q", "detach", "d" }; + // TODO: private static readonly string[] DebuggerCommands = { "continue", "c", "k", "h", "?", "list", "l", "stepInto", "s", "stepOut", "o", "stepOver", "v", "quit", "q", "detach", "d" }; public override IReadOnlyList Run(CancellationToken cancellationToken) { @@ -66,7 +66,7 @@ public override IReadOnlyList Run(CancellationToken cancellationToken) } return _pwsh.Runspace.Debugger.InBreakpoint - && (IsDebuggerCommand(_psCommand) || _pwsh.Runspace.RunspaceIsRemote) + // TODO: && (IsDebuggerCommand(_psCommand) || _pwsh.Runspace.RunspaceIsRemote) ? ExecuteInDebugger(cancellationToken) : ExecuteNormally(cancellationToken); } @@ -78,6 +78,7 @@ public override IReadOnlyList Run(CancellationToken cancellationToken) public override string ToString() => _psCommand.GetInvocationText(); + /* TODO: Make this fix actually work. private static bool IsDebuggerCommand(PSCommand command) { if (command.Commands.Count is not 1 @@ -97,6 +98,7 @@ private static bool IsDebuggerCommand(PSCommand command) return false; } + */ private IReadOnlyList ExecuteNormally(CancellationToken cancellationToken) {