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
This commit is contained in:
Christian Clason
2023-08-09 11:06:13 +02:00
committed by GitHub
parent 8afdc1f386
commit c43c745a14
25 changed files with 111 additions and 95 deletions

View File

@@ -17,7 +17,7 @@ end
--- Stops and closes a libuv |uv_fs_event_t| or |uv_fs_poll_t| handle
---
---@param handle (uv_fs_event_t|uv_fs_poll_t) The handle to stop
---@param handle (uv.uv_fs_event_t|uv.uv_fs_poll_t) The handle to stop
local function stop(handle)
local _, stop_err = handle:stop()
assert(not stop_err, stop_err)
@@ -79,7 +79,7 @@ local default_poll_interval_ms = 2000
--- @field children? table<string,watch.Watches>
--- @field cancel? fun()
--- @field started? boolean
--- @field handle? uv_fs_poll_t
--- @field handle? uv.uv_fs_poll_t
--- @class watch.PollOpts
--- @field interval? integer