Skip to content

Commit

Permalink
ignore unknown fields in initialization options
Browse files Browse the repository at this point in the history
  • Loading branch information
Techatrix committed Nov 12, 2024
1 parent 768463d commit a5f518d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Server.zig
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,9 @@ fn initializeHandler(server: *Server, arena: std.mem.Allocator, request: types.I
server.status = .initializing;

if (request.initializationOptions) |initialization_options| {
if (std.json.parseFromValueLeaky(Config, arena, initialization_options, .{})) |new_cfg| {
if (std.json.parseFromValueLeaky(Config, arena, initialization_options, .{
.ignore_unknown_fields = true,
})) |new_cfg| {
try server.updateConfiguration2(new_cfg, .{});
} else |err| {
log.err("failed to read initialization_options: {}", .{err});
Expand Down

0 comments on commit a5f518d

Please sign in to comment.