LSP plugins don't receive workspace root (rootUri), breaking .luarc.json discovery

Resolved 💬 5 comments Opened Feb 20, 2026 by SSyl Closed Mar 21, 2026

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.library paths don't load (custom type definitions missing)
  • diagnostics.globals settings don't apply
  • runtime.version isn't set

This likely affects other LSP servers that depend on workspace root for configuration discovery as well.

Observed behavior

  1. .luarc.json exists in the project root (the Claude Code working directory)
  2. The lua-lsp plugin launches lua-language-server
  3. lua-language-server does not find or load .luarc.json
  4. Running lua-language-server --check directly from the same directory with --configpath works 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

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗