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

Extension attempts to modify system-wide ZLS settings #398

Open
mtlynch opened this issue Feb 14, 2025 · 0 comments
Open

Extension attempts to modify system-wide ZLS settings #398

mtlynch opened this issue Feb 14, 2025 · 0 comments

Comments

@mtlynch
Copy link

mtlynch commented Feb 14, 2025

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

  1. Make ~/.confg/Code/user/settings.jsonread-only
  2. Open VS Code in an empty directory
  3. Install ZIg VS Code extension
  4. From command pallette, choose "Zig Setup: Install Zig"
  5. Choose latest version of Zig
  6. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant