Fix sending null

This commit is contained in:
Palanix 2025-12-15 12:44:32 +01:00 committed by CJ van den Berg
parent 55b428cea6
commit 8aa8e5cd3d

View file

@ -2028,7 +2028,7 @@ fn send_lsp_init_request(self: *Self, lsp: *const LSP, project_path: []const u8,
const initializationOptions: struct { const initializationOptions: struct {
pub fn cborEncode(self_: @This(), writer: *std.Io.Writer) std.io.Writer.Error!void { pub fn cborEncode(self_: @This(), writer: *std.Io.Writer) std.io.Writer.Error!void {
const toCbor = cbor.fromJsonAlloc(self_.alloc, self_.options) catch { const toCbor = cbor.fromJsonAlloc(self_.alloc, self_.options) catch {
try cbor.writeValue(writer, cbor.null_); try cbor.writeValue(writer, null);
return; return;
}; };
defer self_.alloc.free(toCbor); defer self_.alloc.free(toCbor);