Description
When the Zig extension prompts me to install ZLS, if I say yes, it attempts to write to ~/.confg/Code/user/settings.json
, which is the system-wide config file for VS Code.
On my system, this doesn't work because I manage my home directory with Home Manager, so the settings.json
file is read-only.
Repro steps
- Make
~/.confg/Code/user/settings.json
read-only - Open VS Code in an empty directory
- Install ZIg VS Code extension
- From command pallette, choose "Zig Setup: Install Zig"
- Choose latest version of Zig
- When prompted, choose to install ZLS
Expected behavior
Extension installs ZLS successfully and enables it within VS Code.
I'd prefer that it write to the project-local .vscode/settings.json
rather than the system-wide version, but failing that, I'd like it to at least fail over to the project-local settings one when it can't write the system-wide settings.json
.
Actual behavior
Installation fails with this message:
Failed to install Zig 0.14.0-dev.3220: Unable to write into user settings because the file has unsaved changes. Please save the user settings file first and then try again.
Workaround
Add this line to .vscode/settings.json
in the local project:
"zig.zls.enabled": "on"
Then reload VS Code.
Environment
- OS: NixOS 24.11 (Linux 6.12.12)
- VS Code: 1.97.0
- Zig VS Code Extension: 0.6.4
- Architecture: AMD64
Activity