feat(lsp): workspace_required #31824

Problem:
Some language servers do not work properly without a workspace folder.

Solution:
Add `workspace_required`, which skips starting the lsp client if no
workspace folder is found.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
Michael Strobel
2025-03-30 20:07:53 +02:00
committed by GitHub
parent de96063bda
commit 90d15227c5
5 changed files with 173 additions and 119 deletions

View File

@ -63,6 +63,9 @@ local validate = vim.validate
--- folder in this list. See `workspaceFolders` in the LSP spec.
--- @field workspace_folders? lsp.WorkspaceFolder[]
---
--- (default false) Server requires a workspace (no "single file" support).
--- @field workspace_required? boolean
---
--- Map overriding the default capabilities defined by |vim.lsp.protocol.make_client_capabilities()|,
--- passed to the language server on initialization. Hint: use make_client_capabilities() and modify
--- its result.