mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
docs: api, pack, events, develop
This commit is contained in:
@@ -1653,14 +1653,12 @@ function lsp.with(handler, override_config)
|
||||
end
|
||||
end
|
||||
|
||||
--- Registry (a table) for client-side handlers, for custom server-commands that are not in the LSP
|
||||
--- specification.
|
||||
--- Map of client-defined handlers implementing custom (off-spec) commands which a server may
|
||||
--- invoke. Each key is a unique command name; each value is a function which is called when an LSP
|
||||
--- action (code action, code lenses, …) requests it by name.
|
||||
---
|
||||
--- If an LSP response contains a command which is not found in `vim.lsp.commands`, the command will
|
||||
--- be executed via the LSP server using `workspace/executeCommand`.
|
||||
---
|
||||
--- Each key in the table is a unique command name, and each value is a function which is called
|
||||
--- when an LSP action (code action, code lenses, …) triggers the command.
|
||||
--- If an LSP response requests a command not defined client-side, Nvim will forward it to the
|
||||
--- server as `workspace/executeCommand`.
|
||||
---
|
||||
--- - Argument 1 is the `Command`:
|
||||
--- ```
|
||||
@@ -1686,7 +1684,7 @@ end
|
||||
--- end
|
||||
--- ```
|
||||
---
|
||||
--- @type table<string,function>
|
||||
--- @type table<string,fun(command: lsp.Command, ctx: table)>
|
||||
lsp.commands = setmetatable({}, {
|
||||
__newindex = function(tbl, key, value)
|
||||
assert(type(key) == 'string', 'The key for commands in `vim.lsp.commands` must be a string')
|
||||
|
||||
Reference in New Issue
Block a user