Skip to content

Commit 71ef7e4

Browse files
Add Shutdown(CancellationToken token)
1 parent 68680df commit 71ef7e4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Client/LanguageClient.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,20 @@ private void RegisterCapabilities(ClientCapabilities capabilities)
420420
}
421421

422422
public async Task Shutdown()
423+
{
424+
await Shutdown(CancellationToken.None);
425+
}
426+
427+
public async Task Shutdown(CancellationToken token)
423428
{
424429
if (_connection.IsOpen)
425430
{
426-
await this.RequestShutdown().ConfigureAwait(false);
431+
try
432+
{
433+
await this.RequestShutdown(token).ConfigureAwait(false);
434+
}
435+
catch (TaskCanceledException) { }
436+
427437
this.SendExit();
428438
}
429439

0 commit comments

Comments
 (0)