Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't send empty string configs to ZLS where null would be expected #252

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/zls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ async function configurationMiddleware(
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;
}
}

Expand Down Expand Up @@ -419,14 +422,14 @@ export async function activate(context: vscode.ExtensionContext) {
statusItem,
vscode.commands.registerCommand("zig.zls.enable", async () => {
const zlsConfig = vscode.workspace.getConfiguration("zig.zls");
await zlsConfig.update("enabled", "on");
await zlsConfig.update("enabled", "on", true);
}),
vscode.commands.registerCommand("zig.zls.stop", async () => {
await stopClient();
}),
vscode.commands.registerCommand("zig.zls.startRestart", async () => {
const zlsConfig = vscode.workspace.getConfiguration("zig.zls");
await zlsConfig.update("enabled", "on");
await zlsConfig.update("enabled", "on", true);
await restartClient(context);
}),
vscode.commands.registerCommand("zig.zls.openOutput", () => {
Expand Down
Loading