Compare commits
No commits in common. "88ab698602353a8dfe2d3b8e7445cf7172e42c18" and "55b428cea6cd8aaca430eecb3535abdbacf03456" have entirely different histories.
88ab698602
...
55b428cea6
1 changed files with 7 additions and 8 deletions
|
|
@ -2026,19 +2026,18 @@ fn send_lsp_init_request(self: *Self, lsp: *const LSP, project_path: []const u8,
|
||||||
|
|
||||||
const version = if (root.version.len > 0 and root.version[0] == 'v') root.version[1..] else root.version;
|
const version = if (root.version.len > 0 and root.version[0] == 'v') root.version[1..] else root.version;
|
||||||
const initializationOptions: struct {
|
const initializationOptions: struct {
|
||||||
pub fn cborEncode(ctx: @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(ctx.self.allocator, ctx.language_server_options) catch {
|
const toCbor = cbor.fromJsonAlloc(self_.alloc, self_.options) catch {
|
||||||
try cbor.writeValue(writer, null);
|
try cbor.writeValue(writer, cbor.null_);
|
||||||
ctx.self.logger_lsp.print_err("init", "ignored invalid JSON in LSP initialization options", .{});
|
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
defer ctx.self.allocator.free(toCbor);
|
defer self_.alloc.free(toCbor);
|
||||||
|
|
||||||
writer.writeAll(toCbor) catch return error.WriteFailed;
|
writer.writeAll(toCbor) catch return error.WriteFailed;
|
||||||
}
|
}
|
||||||
self: *Self,
|
options: []const u8,
|
||||||
language_server_options: []const u8,
|
alloc: std.mem.Allocator,
|
||||||
} = .{ .self = self, .language_server_options = language_server_options };
|
} = .{ .options = language_server_options, .alloc = self.allocator };
|
||||||
|
|
||||||
try lsp.send_request(self.allocator, "initialize", .{
|
try lsp.send_request(self.allocator, "initialize", .{
|
||||||
.initializationOptions = initializationOptions,
|
.initializationOptions = initializationOptions,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue