diff options
author | Christian Clason <c.clason@uni-graz.at> | 2023-08-09 11:06:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-09 11:06:13 +0200 |
commit | c43c745a14dced87a23227d7be4f1c33d4455193 (patch) | |
tree | 0cd5cf1cbbfa20be7fffbad696ba5ee97181847e /runtime/lua/vim/shared.lua | |
parent | 8afdc1f3867a620c8235b3d3964b019b94657190 (diff) | |
download | rneovim-c43c745a14dced87a23227d7be4f1c33d4455193.tar.gz rneovim-c43c745a14dced87a23227d7be4f1c33d4455193.tar.bz2 rneovim-c43c745a14dced87a23227d7be4f1c33d4455193.zip |
fix(lua): improve annotations for stricter luals diagnostics (#24609)
Problem: luals returns stricter diagnostics with bundled luarc.json
Solution: Improve some function and type annotations:
* use recognized uv.* types
* disable diagnostic for global `vim` in shared.lua
* docs: don't start comment lines with taglink (otherwise LuaLS will interpret it as a type)
* add type alias for lpeg pattern
* fix return annotation for `vim.secure.trust`
* rename local Range object in vim.version (shadows `Range` in vim.treesitter)
* fix some "missing fields" warnings
* add missing required fields for test functions in eval.lua
* rename lsp meta files for consistency
Diffstat (limited to 'runtime/lua/vim/shared.lua')
-rw-r--r-- | runtime/lua/vim/shared.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua index 32575a1cc9..422d49d746 100644 --- a/runtime/lua/vim/shared.lua +++ b/runtime/lua/vim/shared.lua @@ -6,6 +6,7 @@ -- or the test suite. (Eventually the test suite will be run in a worker process, -- so this wouldn't be a separate case to consider) +---@diagnostic disable-next-line: lowercase-global vim = vim or {} local function _id(v) @@ -533,7 +534,7 @@ end ---@see Based on https://github.com/premake/premake-core/blob/master/src/base/table.lua --- ---@param t table Dict-like table ----@return # iterator over sorted keys and their values +---@return function iterator over sorted keys and their values function vim.spairs(t) assert(type(t) == 'table', string.format('Expected table, got %s', type(t))) |