aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_watch.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2026-09-28 14:19:42 +0100
committerLewis Russell <lewis6991@gmail.com>2026-09-28 14:43:14 +0100
commitc6535538f8717a8f6134020a5bee65341cf8280f (patch)
treea3c7512c9b98a571744d49ca6ff7f8c6568d373e /runtime/lua/vim/_watch.lua
parentb597af006fbb7c94c03ea9e7fa13cab7394b0501 (diff)
downloadrneovim-c6535538f8717a8f6134020a5bee65341cf8280f.tar.gz
rneovim-c6535538f8717a8f6134020a5bee65341cf8280f.tar.bz2
rneovim-c6535538f8717a8f6134020a5bee65341cf8280f.zip
fix(lua): enable param-type-mismatch diagnostic
Problem: Argument type mismatches are excluded from EmmyLua checks. Solution: Correct runtime annotations and calls, document local checker workarounds, and enable the diagnostic. AI-assisted
Diffstat (limited to 'runtime/lua/vim/_watch.lua')
-rw-r--r--runtime/lua/vim/_watch.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/lua/vim/_watch.lua b/runtime/lua/vim/_watch.lua
index 08fd45046e..1313d6621b 100644
--- a/runtime/lua/vim/_watch.lua
+++ b/runtime/lua/vim/_watch.lua
@@ -122,6 +122,8 @@ local function emit(entry, method, ...)
-- Callbacks can subscribe or cancel other subscriptions while handling an event.
for _, subscriber in ipairs(vim.tbl_keys(entry.subscribers)) do
if entry.subscribers[subscriber] then
+ -- EmmyLua rejects the union of callback signatures passed to pcall.
+ --- @diagnostic disable-next-line: param-type-mismatch
local ok, err = pcall(subscriber[method], ...)
if not ok then
first_error = first_error or tostring(err)
@@ -549,7 +551,7 @@ local function on_inotifywait_output(data, opts, callback)
local d = vim.split(data, '%s+')
-- only consider the last reported event
- local path, event, file = d[1], d[2], d[#d]
+ local path, event, file = assert(d[1]), d[2], d[#d]
local fullpath = vim.fs.joinpath(path, file)
if skip(fullpath, opts) then