Skip to content

Conversation

@Techatrix
Copy link
Member

It turns out that ZLS has been relying on the outdated workspace/didChangeConfiguration request even in editors that supported workspace/Configuration.

This change may require updating the user config to ensure ZLS options set in the editor config continue to work.

Sublime Text
{
  "clients": {
    "zls": {
      "enabled": true,
      // ...
      "settings": {
-        "zig_exe_path": "/path/to/zig_executable"
-        "enable_build_on_save": true
+        "zls": {
+          "zig_exe_path": "/path/to/zig_executable"
+          "enable_build_on_save": true
+        }
      }
    }
  }
}
Helix
[language-server.zls]
command = "/path/to/zls_executable"
- config.enable_build_on_save = true
- config.zig_exe_path = "/path/to/zig_executable"
+ config.zls.enable_build_on_save = true
+ config.zls.zig_exe_path = "/path/to/zig_executable"
Zed
{
  "lsp": {
    "zls": {
      "binary": {...},
      "settings": {
-       "enable_build_on_save": true,
-       "zig_exe_path": "/path/to/zig_executable"
+       "zls": {
+         "enable_build_on_save": true,
+         "zig_exe_path": "/path/to/zig_executable"
+       }
      }
    }
  }
}
Neovim
lspconfig.zls.setup {
  cmd = { '/path/to/zls_executable' },
  settings = {
-   enable_build_on_save = true,
-   zig_exe_path = '/path/to/zig_executable'
+   zls = {
+     enable_build_on_save = true,
+     zig_exe_path = '/path/to/zig_executable'
+   }
  }
}

…ported

For some editor, ZLS would still use the outdated push model with
`workspace/didChangeConfiguration` even if they supported the pull model
with `workspace/Configuration`.
@Techatrix Techatrix force-pushed the techatrix/i_haz_configuration branch from 0ae73c8 to 7f9bafc Compare July 22, 2025 18:29
@Techatrix Techatrix merged commit 957eb87 into master Jul 22, 2025
4 checks passed
@Techatrix Techatrix deleted the techatrix/i_haz_configuration branch July 22, 2025 18:32
Techatrix added a commit that referenced this pull request Jul 22, 2025
I got to eager.
@Techatrix
Copy link
Member Author

Reverted in 1656b5d until ziglang/vscode-zig#442 has been merged to make this work with the VS Code extension for Zig.

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

Successfully merging this pull request may close these issues.

2 participants