Skip to content

Commit b592189

Browse files
TechatrixVexu
authored andcommitted
fix configuration middleware for non string config options
fixes #256
1 parent 542d1b3 commit b592189

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/zls.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,9 @@ async function configurationMiddleware(
173173
const index = optionIndices[name] as unknown as number;
174174
const section = name.slice("zig.zls.".length);
175175
const configValue = configuration.get(section);
176-
if (typeof configValue === "string" && configValue) {
177-
result[index] = handleConfigOption(configValue);
178-
} else {
179-
// Make sure that `""` gets converted to `null`
180-
result[index] = null;
176+
if (typeof configValue === "string") {
177+
// Make sure that `""` gets converted to `null` and resolve predefined values
178+
result[index] = configValue ? handleConfigOption(configValue) : null;
181179
}
182180
}
183181

0 commit comments

Comments
 (0)