Skip to content

Commit

Permalink
Add Shutdown(CancellationToken token)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcholette committed Feb 14, 2024
1 parent 68680df commit 71ef7e4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Client/LanguageClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 71ef7e4

Please sign in to comment.