send response on shutdown request (#1037)

This commit is contained in:
Techatrix 2023-03-06 18:34:09 +00:00 committed by GitHub
parent 1fb7bfc63f
commit 421a05ae5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1979,7 +1979,7 @@ fn initializedHandler(server: *Server, notification: types.InitializedParams) Er
try server.requestConfiguration(); try server.requestConfiguration();
} }
fn shutdownHandler(server: *Server, _: void) Error!void { fn shutdownHandler(server: *Server, _: void) Error!?void {
defer server.status = .shutdown; defer server.status = .shutdown;
if (server.status != .initialized) return error.InvalidRequest; // received a shutdown request but the server is not initialized! if (server.status != .initialized) return error.InvalidRequest; // received a shutdown request but the server is not initialized!
} }