From d55330bcd13edc38c333475cc3369ef8e879fbb7 Mon Sep 17 00:00:00 2001 From: Maria José Solano Date: Sun, 20 Apr 2025 14:54:31 -0700 Subject: refactor(lsp): use method type annotations for parameters --- runtime/lua/vim/lsp.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/lua/vim/lsp.lua') diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index c618be7fd9..544466a9fc 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -43,7 +43,7 @@ lsp._resolve_to_request = { ---@private --- Called by the client when trying to call a method that's not --- supported in any of the servers registered for the current buffer. ----@param method (string) name of the method +---@param method (vim.lsp.protocol.Method.ClientToServer) name of the method function lsp._unsupported_method(method) local msg = string.format( 'method %s is not supported by any of the servers registered for the current buffer', @@ -1183,7 +1183,7 @@ api.nvim_create_autocmd('VimLeavePre', { --- buffer. --- ---@param bufnr (integer) Buffer handle, or 0 for current. ----@param method (string) LSP method name +---@param method (vim.lsp.protocol.Method.ClientToServer.Request) LSP method name ---@param params? table|(fun(client: vim.lsp.Client, bufnr: integer): table?) Parameters to send to the server ---@param handler? lsp.Handler See |lsp-handler| --- If nil, follows resolution strategy defined in |lsp-handler-configuration| @@ -1246,7 +1246,7 @@ end ---@since 7 --- ---@param bufnr (integer) Buffer handle, or 0 for current. ----@param method (string) LSP method name +---@param method (vim.lsp.protocol.Method.ClientToServer.Request) LSP method name ---@param params? table|(fun(client: vim.lsp.Client, bufnr: integer): table?) Parameters to send to the server. --- Can also be passed as a function that returns the params table for cases where --- parameters are specific to the client. @@ -1317,7 +1317,7 @@ end ---@since 7 --- ---@param bufnr (integer|nil) The number of the buffer ----@param method (string) Name of the request method +---@param method (vim.lsp.protocol.Method.ClientToServer.Notification) Name of the request method ---@param params (any) Arguments to send to the server --- ---@return boolean success true if any client returns true; false otherwise -- cgit