commit 9988d7142d65f1bd732480d7d942ccd16669c5b2
parent 1f0dbfea2f2ee220da12998ce9ae2bb8e8c3f186
Author: Josh Cooper <josh@cooper.dev>
Date: Thu, 22 Jan 2026 19:48:54 +0000
fix(types): add missing @return annotations
Diffstat:
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
@@ -783,8 +783,9 @@ count({bufnr}, {opts}) *vim.diagnostic.count()*
• {opts} (`vim.diagnostic.GetOpts?`) See |vim.diagnostic.GetOpts|.
Return: ~
- (`table`) Table with actually present severity values as keys (see
- |diagnostic-severity|) and integer counts as values.
+ (`table<integer, integer>`) Table with actually present severity
+ values as keys (see |diagnostic-severity|) and integer counts as
+ values.
enable({enable}, {filter}) *vim.diagnostic.enable()*
Enables or disables diagnostics.
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
@@ -1637,7 +1637,7 @@ Lua module: vim.lsp.client *lsp-client*
See |Client:exec_cmd()|.
• {on_attach} (`fun(self: vim.lsp.Client, bufnr: integer)`)
See |Client:on_attach()|.
- • {supports_method} (`fun(self: vim.lsp.Client, method: string|string, bufnr: integer?)`)
+ • {supports_method} (`fun(self: vim.lsp.Client, method: string|string, bufnr: integer?): boolean`)
See |Client:supports_method()|.
*vim.lsp.Client.Progress*
@@ -1897,6 +1897,9 @@ Client:supports_method({method}, {bufnr}) *Client:supports_method()*
• {method} (`string|string`)
• {bufnr} (`integer?`)
+ Return: ~
+ (`boolean`)
+
==============================================================================
Lua module: vim.lsp.codelens *lsp-codelens*
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua
@@ -1485,7 +1485,7 @@ end
---@param bufnr? integer Buffer number to get diagnostics from. Use 0 for
--- current buffer or nil for all buffers.
---@param opts? vim.diagnostic.GetOpts
----@return table : Table with actually present severity values as keys
+---@return table<integer, integer> : Table with actually present severity values as keys
--- (see |diagnostic-severity|) and integer counts as values.
function M.count(bufnr, opts)
vim.validate('bufnr', bufnr, 'number', true)
diff --git a/runtime/lua/vim/lsp/client.lua b/runtime/lua/vim/lsp/client.lua
@@ -1191,6 +1191,7 @@ end
--- Note: Some language server capabilities can be file specific.
--- @param method vim.lsp.protocol.Method.ClientToServer | vim.lsp.protocol.Method.Registration
--- @param bufnr? integer
+--- @return boolean
function Client:supports_method(method, bufnr)
-- Deprecated form
if type(bufnr) == 'table' then