diff --git a/src/Features/LanguageServer/Protocol/Handler/RequestExecutionQueue.cs b/src/Features/LanguageServer/Protocol/Handler/RequestExecutionQueue.cs index 4508942959f1..190eed006a57 100644 --- a/src/Features/LanguageServer/Protocol/Handler/RequestExecutionQueue.cs +++ b/src/Features/LanguageServer/Protocol/Handler/RequestExecutionQueue.cs @@ -228,10 +228,12 @@ private async Task ProcessQueueAsync() } } } - catch (OperationCanceledException e) when (e.CancellationToken == _cancelSource.Token) + catch (OperationCanceledException) { - // If the queue is asked to shut down between the start of the while loop, and the Dequeue call - // we could end up here, but we don't want to report an error. The Shutdown call will take care of things. + // If we're being cancelled then we shut down but logging it as an exception is misleading in the logs + // If we have shut ourselves down then calling Shutdown() here is redundant, but there is no issue calling + // it multiple times so better safe than sorry. + Shutdown(); } catch (Exception e) when (FatalError.ReportAndCatch(e)) {