LSP plugins don't receive workspace root (rootUri), breaking .luarc.json discovery
Problem
When Claude Code launches an LSP server via a plugin's .lsp.json configuration, it doesn't appear to pass the workspace root as rootUri during LSP initialization. This prevents language servers from auto-discovering per-project configuration files.
Specifically, lua-language-server relies on rootUri to find .luarc.json in the workspace root. Without it, the server runs in single-file mode and all configuration is ignored:
workspace.librarypaths don't load (custom type definitions missing)diagnostics.globalssettings don't applyruntime.versionisn't set
This likely affects other LSP servers that depend on workspace root for configuration discovery as well.
Observed behavior
.luarc.jsonexists in the project root (the Claude Code working directory)- The lua-lsp plugin launches
lua-language-server lua-language-serverdoes not find or load.luarc.json- Running
lua-language-server --checkdirectly from the same directory with--configpathworks perfectly
This suggests the issue is that Claude Code doesn't pass rootUri (or passes it incorrectly) when initializing the LSP server.
Expected behavior
Claude Code should pass the current working directory (or the project root) as rootUri in the LSP initialize request, so language servers can auto-discover their configuration files.
Workaround
I created a plugin that explicitly passes --configpath to lua-language-server: https://github.com/SSyl/claude-win-lsps
Users have to manually edit the cached .lsp.json to hardcode the path to their .luarc.json after installing. This works but shouldn't be necessary.
Additional context
The LSP plugin schema supports a workspaceFolder field according to the docs, but the official lua-lsp@claude-plugins-official plugin doesn't use it (the plugin is just a README with no configuration). Even if the plugin set workspaceFolder, it would need to be dynamic per-project rather than hardcoded.
Environment
- Windows 11
- Claude Code (latest)
- lua-language-server 3.17.1
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗