Skip to content

Commit 4a22daa

Browse files
authored
Add SendEmptyRequest Method for shutdown request (#233)
1 parent a004474 commit 4a22daa

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/Client/LanguageClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ public async Task Shutdown()
300300
{
301301
if (connection.IsOpen)
302302
{
303-
connection.SendEmptyNotification("shutdown");
303+
await connection.SendEmptyRequest("shutdown");
304304
connection.SendEmptyNotification("exit");
305305
connection.Disconnect(flushOutgoing: true);
306306
}

src/Client/Protocol/LspConnection.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,17 @@ public void SendNotification(string method, object notification)
352352
});
353353
}
354354

355+
/// <summary>
356+
/// Send an empty request to the language server.
357+
/// </summary>
358+
/// <param name="method">
359+
/// The request method name.
360+
/// </param>
361+
public Task SendEmptyRequest(string method)
362+
{
363+
return SendRequest(method, EmptyRequest.Instance);
364+
}
365+
355366
/// <summary>
356367
/// Send a request to the language server.
357368
/// </summary>

0 commit comments

Comments
 (0)