Skip to content

Commit

Permalink
Fix ShowHelpHandler by running with RequiresForeground (#1970)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andyleejordan authored Dec 9, 2022
1 parent c0aeb0f commit e28d8df
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@ public async Task<Unit> 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<PSObject>(checkHelpPSCommand, cancellationToken, new PowerShellExecutionOptions { WriteOutputToHost = true, ThrowOnError = false }).ConfigureAwait(false);
await _executionService.ExecutePSCommandAsync<PSObject>(
checkHelpPSCommand,
cancellationToken,
new PowerShellExecutionOptions
{
RequiresForeground = true,
WriteOutputToHost = true,
ThrowOnError = false
}).ConfigureAwait(false);
return Unit.Value;
}
}
Expand Down

0 comments on commit e28d8df

Please sign in to comment.