From c43c745a14dced87a23227d7be4f1c33d4455193 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 9 Aug 2023 11:06:13 +0200 Subject: 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 --- runtime/lua/vim/_watch.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim/_watch.lua') diff --git a/runtime/lua/vim/_watch.lua b/runtime/lua/vim/_watch.lua index dc5f59f38b..7230b31f6f 100644 --- a/runtime/lua/vim/_watch.lua +++ b/runtime/lua/vim/_watch.lua @@ -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 --- @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 -- cgit