Skip to content

Commit

Permalink
fix configuration middleware for non string config options
Browse files Browse the repository at this point in the history
fixes  #256
  • Loading branch information
Techatrix authored and Vexu committed Dec 11, 2024
1 parent 542d1b3 commit b592189
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/zls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,9 @@ async function configurationMiddleware(
const index = optionIndices[name] as unknown as number;
const section = name.slice("zig.zls.".length);
const configValue = configuration.get(section);
if (typeof configValue === "string" && configValue) {
result[index] = handleConfigOption(configValue);
} else {
// Make sure that `""` gets converted to `null`
result[index] = null;
if (typeof configValue === "string") {
// Make sure that `""` gets converted to `null` and resolve predefined values
result[index] = configValue ? handleConfigOption(configValue) : null;
}
}

Expand Down

0 comments on commit b592189

Please sign in to comment.