diff options
author | Jongwook Choi <wookayin@gmail.com> | 2024-01-09 18:04:27 -0500 |
---|---|---|
committer | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2024-01-14 09:02:45 +0100 |
commit | ce4ea638c703275aedadb3794efc56dcb782c908 (patch) | |
tree | fb87b6bffed8bf18670b84aaec668194e2b721ba /runtime/lua/vim/lsp.lua | |
parent | 92c59c39c3d98d313071f9761c448e8acfd00118 (diff) | |
download | rneovim-ce4ea638c703275aedadb3794efc56dcb782c908.tar.gz rneovim-ce4ea638c703275aedadb3794efc56dcb782c908.tar.bz2 rneovim-ce4ea638c703275aedadb3794efc56dcb782c908.zip |
fix(lsp): fix incorrect typing and doc for `vim.lsp.rpc`
Typings introduced in #26032 and #26552 have a few conflicts, so we
merge and clean them up. We also fix some incorrect type annotation in
the `vim.lsp.rpc` package. See the associated PR for more details.
Summary:
- vim.rpc.Dispatchers -> vim.lsp.rpc.Dispatchers
- vim.lsp.rpc.Error -> lsp.ResponseError
- Revise docs
Diffstat (limited to 'runtime/lua/vim/lsp.lua')
-rw-r--r-- | runtime/lua/vim/lsp.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index b2aa943359..a02a93d559 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -258,7 +258,7 @@ end --- Validates a client configuration as given to |vim.lsp.start_client()|. --- ---@param config (lsp.ClientConfig) ----@return (string|fun(dispatchers:vim.rpc.Dispatchers):RpcClientPublic?) Command +---@return (string|fun(dispatchers:vim.rpc.Dispatchers):vim.lsp.rpc.PublicClient?) Command ---@return string[] Arguments ---@return string Encoding. local function validate_client_config(config) @@ -291,7 +291,7 @@ local function validate_client_config(config) 'flags.debounce_text_changes must be a number with the debounce time in milliseconds' ) - local cmd, cmd_args --- @type (string|fun(dispatchers:vim.rpc.Dispatchers):RpcClientPublic), string[] + local cmd, cmd_args --- @type (string|fun(dispatchers:vim.rpc.Dispatchers):vim.lsp.rpc.PublicClient), string[] local config_cmd = config.cmd if type(config_cmd) == 'function' then cmd = config_cmd @@ -826,6 +826,8 @@ function lsp.start_client(config) --- ---@param method (string) LSP method name ---@param params (table) The parameters for that method + ---@return any result + ---@return lsp.ResponseError error code and message set in case an exception happens during the request. function dispatch.server_request(method, params) if log.trace() then log.trace('server_request', method, params) @@ -953,7 +955,7 @@ function lsp.start_client(config) end -- Start the RPC client. - local rpc --- @type RpcClientPublic? + local rpc --- @type vim.lsp.rpc.PublicClient? if type(cmd) == 'function' then rpc = cmd(dispatch) else |