mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
docs(lsp): type annotation for lsp.client (#22509)
* Also fix newly found type mismatch. * Note that it generates new warnings about using @private client methods. A proper fix would be to revamp the lsp client documentation altogether.
This commit is contained in:
parent
68aa2857dd
commit
0ecb4d725e
@ -655,7 +655,7 @@ buf_notify({bufnr}, {method}, {params}) *vim.lsp.buf_notify()*
|
|||||||
Send a notification to a server
|
Send a notification to a server
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {bufnr} (number|nil) The number of the buffer
|
• {bufnr} (integer|nil) The number of the buffer
|
||||||
• {method} (string) Name of the request method
|
• {method} (string) Name of the request method
|
||||||
• {params} (any) Arguments to send to the server
|
• {params} (any) Arguments to send to the server
|
||||||
|
|
||||||
|
@ -154,6 +154,8 @@ local all_buffer_active_clients = {}
|
|||||||
local uninitialized_clients = {}
|
local uninitialized_clients = {}
|
||||||
|
|
||||||
---@private
|
---@private
|
||||||
|
---@param bufnr? integer
|
||||||
|
---@param fn fun(client: lsp.Client, client_id: integer, bufnr: integer)
|
||||||
local function for_each_buffer_client(bufnr, fn, restrict_client_ids)
|
local function for_each_buffer_client(bufnr, fn, restrict_client_ids)
|
||||||
validate({
|
validate({
|
||||||
fn = { fn, 'f' },
|
fn = { fn, 'f' },
|
||||||
@ -1240,6 +1242,7 @@ function lsp.start_client(config)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@class lsp.Client
|
||||||
local client = {
|
local client = {
|
||||||
id = client_id,
|
id = client_id,
|
||||||
name = name,
|
name = name,
|
||||||
@ -1390,7 +1393,7 @@ function lsp.start_client(config)
|
|||||||
--- checks for capabilities and handler availability.
|
--- checks for capabilities and handler availability.
|
||||||
---
|
---
|
||||||
---@param method string LSP method name.
|
---@param method string LSP method name.
|
||||||
---@param params table LSP request params.
|
---@param params table|nil LSP request params.
|
||||||
---@param handler lsp-handler|nil Response |lsp-handler| for this method.
|
---@param handler lsp-handler|nil Response |lsp-handler| for this method.
|
||||||
---@param bufnr integer Buffer handle (0 for current).
|
---@param bufnr integer Buffer handle (0 for current).
|
||||||
---@return boolean status, integer|nil request_id {status} is a bool indicating
|
---@return boolean status, integer|nil request_id {status} is a bool indicating
|
||||||
@ -2087,7 +2090,7 @@ function lsp.buf_request_sync(bufnr, method, params, timeout_ms)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Send a notification to a server
|
--- Send a notification to a server
|
||||||
---@param bufnr (number|nil) The number of the buffer
|
---@param bufnr (integer|nil) The number of the buffer
|
||||||
---@param method (string) Name of the request method
|
---@param method (string) Name of the request method
|
||||||
---@param params (any) Arguments to send to the server
|
---@param params (any) Arguments to send to the server
|
||||||
---
|
---
|
||||||
|
Loading…
Reference in New Issue
Block a user