diff options
author | Maria José Solano <majosolano99@gmail.com> | 2024-05-04 15:08:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-05 06:08:17 +0800 |
commit | efb44e0cad294f51e330d57d7590d38de5cec62c (patch) | |
tree | 611ff197f474a27dbb42e1b2c63f1c6e949bf455 /runtime/lua/vim | |
parent | e948d7feba240568b1c0ab9bcb37cc264666a67d (diff) | |
download | rneovim-efb44e0cad294f51e330d57d7590d38de5cec62c.tar.gz rneovim-efb44e0cad294f51e330d57d7590d38de5cec62c.tar.bz2 rneovim-efb44e0cad294f51e330d57d7590d38de5cec62c.zip |
docs: fix lua type warnings (#28633)
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r-- | runtime/lua/vim/_meta/api_keysets_extra.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/builtin_types.lua | 8 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/vimfn.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/lsp.lua | 7 | ||||
-rw-r--r-- | runtime/lua/vim/treesitter.lua | 2 |
5 files changed, 15 insertions, 6 deletions
diff --git a/runtime/lua/vim/_meta/api_keysets_extra.lua b/runtime/lua/vim/_meta/api_keysets_extra.lua index d61dd2c02f..76b56b04e7 100644 --- a/runtime/lua/vim/_meta/api_keysets_extra.lua +++ b/runtime/lua/vim/_meta/api_keysets_extra.lua @@ -124,7 +124,7 @@ error('Cannot require a meta file') --- @field commalist boolean --- @field flaglist boolean --- @field was_set boolean ---- @field last_set_id integer +--- @field last_set_sid integer --- @field last_set_linenr integer --- @field last_set_chan integer --- @field type 'string'|'boolean'|'number' diff --git a/runtime/lua/vim/_meta/builtin_types.lua b/runtime/lua/vim/_meta/builtin_types.lua index 0bbc3e9bc8..9f0d2e7038 100644 --- a/runtime/lua/vim/_meta/builtin_types.lua +++ b/runtime/lua/vim/_meta/builtin_types.lua @@ -127,3 +127,11 @@ --- @field skipcol integer --- @field topfill integer --- @field topline integer + +--- @class vim.fn.getscriptinfo.ret +--- @field autoload false +--- @field functions? string[] +--- @field name string +--- @field sid string +--- @field variables? table<string, any> +--- @field version 1 diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 6674bbf82d..dc25b0dd40 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -3632,7 +3632,7 @@ function vim.fn.getregtype(regname) end --- < --- --- @param opts? table ---- @return any +--- @return vim.fn.getscriptinfo.ret[] function vim.fn.getscriptinfo(opts) end --- If {tabnr} is not specified, then information about all the diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index c6d6c8a0cd..325c30ca38 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -310,6 +310,7 @@ local function is_empty_or_default(bufnr, option) end local info = api.nvim_get_option_info2(option, { buf = bufnr }) + ---@param e vim.fn.getscriptinfo.ret local scriptinfo = vim.tbl_filter(function(e) return e.sid == info.last_set_sid end, vim.fn.getscriptinfo()) @@ -515,7 +516,7 @@ local function buf_attach(bufnr) textDocument = { uri = uri, }, - reason = protocol.TextDocumentSaveReason.Manual, + reason = protocol.TextDocumentSaveReason.Manual, ---@type integer } if vim.tbl_get(client.server_capabilities, 'textDocumentSync', 'willSave') then client.notify(ms.textDocument_willSave, params) @@ -899,7 +900,7 @@ end --- a `client_id:result` map. ---@return function cancel Function that cancels all requests. function lsp.buf_request_all(bufnr, method, params, handler) - local results = {} --- @type table<integer,{error:string, result:any}> + local results = {} --- @type table<integer,{error:lsp.ResponseError, result:any}> local result_count = 0 local expected_result_count = 0 @@ -940,7 +941,7 @@ end ---@return table<integer, {err: lsp.ResponseError, result: any}>? result Map of client_id:request_result. ---@return string? err On timeout, cancel, or error, `err` is a string describing the failure reason, and `result` is nil. function lsp.buf_request_sync(bufnr, method, params, timeout_ms) - local request_results + local request_results ---@type table local cancel = lsp.buf_request_all(bufnr, method, params, function(it) request_results = it diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua index 4f4762547a..db544c1ab1 100644 --- a/runtime/lua/vim/treesitter.lua +++ b/runtime/lua/vim/treesitter.lua @@ -327,7 +327,7 @@ function M.get_captures_at_cursor(winnr) end --- Optional keyword arguments: ---- @class vim.treesitter.get_node.Opts +--- @class vim.treesitter.get_node.Opts : vim.treesitter.LanguageTree.tree_for_range.Opts --- @inlinedoc --- --- Buffer number (nil or 0 for current buffer) |