From 0afc1c3b21aaba6663ed74a19055b0e2a32b69c7 Mon Sep 17 00:00:00 2001 From: nullptrdevs <16590917+nullptrdevs@users.noreply.github.com> Date: Fri, 2 Jun 2023 13:46:29 -0700 Subject: [PATCH] Fix `configuration.getConfigurationType` returning non null values (#1220) The function would change the `Config` struct fields' type to optional but keep a non null value which led to `Server.didChangeConfigurationHandler` assigning wrong values to `server.config`. --- src/configuration.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/configuration.zig b/src/configuration.zig index a89dcb3..e81d717 100644 --- a/src/configuration.zig +++ b/src/configuration.zig @@ -226,6 +226,7 @@ fn getConfigurationType() type { .Optional = .{ .child = field.type }, }); } + new_field.default_value = &@as(new_field.type, null); } config_info.Struct.fields = fields[0..]; config_info.Struct.decls = &.{};