From 784047d9522c6f913df44fb662f953afe350b38f Mon Sep 17 00:00:00 2001 From: Techatrix <19954306+Techatrix@users.noreply.github.com> Date: Thu, 1 Dec 2022 10:00:08 +0100 Subject: [PATCH] add a dummy cancelRequest implementation (#790) --- src/Server.zig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Server.zig b/src/Server.zig index 2b0652f..e3175cc 100644 --- a/src/Server.zig +++ b/src/Server.zig @@ -1769,6 +1769,13 @@ fn exitHandler(server: *Server, writer: anytype, id: types.RequestId) noreturn { std.os.exit(error_code); } +fn cancelRequestHandler(server: *Server, writer: anytype, id: types.RequestId) !void { + _ = id; + _ = writer; + _ = server; + // TODO implement $/cancelRequest +} + fn registerCapability(server: *Server, writer: anytype, method: []const u8) !void { const id = try std.fmt.allocPrint(server.arena.allocator(), "register-{s}", .{method}); log.debug("Dynamically registering method '{s}'", .{method}); @@ -2869,10 +2876,10 @@ pub fn processJsonRpc(server: *Server, writer: anytype, json: []const u8) !void const method_map = .{ .{ "initialized", void, initializedHandler }, - .{"$/cancelRequest"}, .{ "initialize", requests.Initialize, initializeHandler }, .{ "shutdown", void, shutdownHandler }, .{ "exit", void, exitHandler }, + .{ "$/cancelRequest", void, cancelRequestHandler }, .{ "textDocument/didOpen", requests.OpenDocument, openDocumentHandler }, .{ "textDocument/didChange", requests.ChangeDocument, changeDocumentHandler }, .{ "textDocument/didSave", requests.SaveDocument, saveDocumentHandler },