diff --git a/src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs b/src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs index a8144d360..29e36ce25 100644 --- a/src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs +++ b/src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs @@ -82,6 +82,11 @@ public override async Task Handle(CompletionParams request, Canc // (typically files) returned by the space completion return new CompletionList(completionResults, isIncomplete || request?.Context?.TriggerCharacter is " "); } + // Ignore canceled requests (logging will pollute the output). + catch (TaskCanceledException) + { + return new CompletionList(isIncomplete: true); + } // We can't do anything about completions failing. catch (Exception e) {