Skip to content

Commit e28d8df

Browse files
Fix ShowHelpHandler by running with RequiresForeground (#1970)
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.
1 parent c0aeb0f commit e28d8df

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: src/PowerShellEditorServices/Services/PowerShell/Handlers/ShowHelpHandler.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@ public async Task<Unit> Handle(ShowHelpParams request, CancellationToken cancell
6767

6868
// TODO: Rather than print the help in the console, we should send the string back
6969
// to VSCode to display in a help pop-up (or similar)
70-
await _executionService.ExecutePSCommandAsync<PSObject>(checkHelpPSCommand, cancellationToken, new PowerShellExecutionOptions { WriteOutputToHost = true, ThrowOnError = false }).ConfigureAwait(false);
70+
await _executionService.ExecutePSCommandAsync<PSObject>(
71+
checkHelpPSCommand,
72+
cancellationToken,
73+
new PowerShellExecutionOptions
74+
{
75+
RequiresForeground = true,
76+
WriteOutputToHost = true,
77+
ThrowOnError = false
78+
}).ConfigureAwait(false);
7179
return Unit.Value;
7280
}
7381
}

0 commit comments

Comments
 (0)