From 7faccfc260858aef0b1d902e3d607d85d25a7cf3 Mon Sep 17 00:00:00 2001 From: Andy Jordan Date: Fri, 9 Dec 2022 11:10:58 -0800 Subject: [PATCH] Fix `ShowHelpHandler` by running with `RequiresForeground` This was broken after the rewrite because we'd forgotten to specify that it needs the foreground (which implies too that it must run immediately). Now the script actually executes, either showing the help in the Extension Terminal (or...I guess nowhere for clients without it) or opening the URL it found. This should still be rewritten properly to return the help over LSP and do something better with it, but at least it's no longer broken. --- .../Services/PowerShell/Handlers/ShowHelpHandler.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/PowerShellEditorServices/Services/PowerShell/Handlers/ShowHelpHandler.cs b/src/PowerShellEditorServices/Services/PowerShell/Handlers/ShowHelpHandler.cs index d2f84b01b..ea18de73c 100644 --- a/src/PowerShellEditorServices/Services/PowerShell/Handlers/ShowHelpHandler.cs +++ b/src/PowerShellEditorServices/Services/PowerShell/Handlers/ShowHelpHandler.cs @@ -67,7 +67,15 @@ public async Task Handle(ShowHelpParams request, CancellationToken cancell // TODO: Rather than print the help in the console, we should send the string back // to VSCode to display in a help pop-up (or similar) - await _executionService.ExecutePSCommandAsync(checkHelpPSCommand, cancellationToken, new PowerShellExecutionOptions { WriteOutputToHost = true, ThrowOnError = false }).ConfigureAwait(false); + await _executionService.ExecutePSCommandAsync( + checkHelpPSCommand, + cancellationToken, + new PowerShellExecutionOptions + { + RequiresForeground = true, + WriteOutputToHost = true, + ThrowOnError = false + }).ConfigureAwait(false); return Unit.Value; } }