feat(lsp): builtin :lsp command

Problem:
- Despite [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
  claims to be a "data-only" plugin, in fact it still provides some
  user-facing commands because they haven't been upstreamed to Nvim.

Solution:
- Upstream `:LspRestart`, `:LspStart` and `:LspStop` commands as `:lsp
  restart`, `:lsp start` and `:lsp stop` respectively.

Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
brianhuster
2025-07-26 18:37:31 +07:00
committed by Justin M. Keyes
parent 89d26d61d2
commit 63abb1a88f
11 changed files with 224 additions and 15 deletions

View File

@@ -528,14 +528,6 @@ end
--- vim.lsp.enable({'lua_ls', 'pyright'})
--- ```
---
--- Example: [lsp-restart]() Passing `false` stops and detaches the client(s). Thus you can
--- "restart" LSP by disabling and re-enabling a given config:
---
--- ```lua
--- vim.lsp.enable('clangd', false)
--- vim.lsp.enable('clangd', true)
--- ```
---
--- Example: To _dynamically_ decide whether LSP is activated, define a |lsp-root_dir()| function
--- which calls `on_dir()` only when you want that config to activate:
---