diff --git a/src/Client/LanguageClient.cs b/src/Client/LanguageClient.cs index 22c7004df..1c97edd0e 100644 --- a/src/Client/LanguageClient.cs +++ b/src/Client/LanguageClient.cs @@ -420,10 +420,20 @@ private void RegisterCapabilities(ClientCapabilities capabilities) } public async Task Shutdown() + { + await Shutdown(CancellationToken.None); + } + + public async Task Shutdown(CancellationToken token) { if (_connection.IsOpen) { - await this.RequestShutdown().ConfigureAwait(false); + try + { + await this.RequestShutdown(token).ConfigureAwait(false); + } + catch (TaskCanceledException) { } + this.SendExit(); }