Skip to content

Commit 30f4ea8

Browse files
committed
Merge pull request #230 from PowerShell/daviwil/fix-222
Fix #222: Prompt functions hang in editor commands
2 parents ba27e4a + 7f72d87 commit 30f4ea8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ private Task HandleInvokeExtensionCommandRequest(
193193
InvokeExtensionCommandRequest commandDetails,
194194
RequestContext<string> requestContext)
195195
{
196+
// We don't await the result of the execution here because we want
197+
// to be able to receive further messages while the editor command
198+
// is executing. This important in cases where the pipeline thread
199+
// gets blocked by something in the script like a prompt to the user.
196200
EditorContext editorContext =
197201
this.editorOperations.ConvertClientEditorContext(
198202
commandDetails.Context);
@@ -207,7 +211,7 @@ private Task HandleInvokeExtensionCommandRequest(
207211
return requestContext.SendResult(null);
208212
});
209213

210-
return commandTask;
214+
return Task.FromResult(true);
211215
}
212216

213217
private async Task HandleExpandAliasRequest(

0 commit comments

Comments
 (0)