From c6535538f8717a8f6134020a5bee65341cf8280f Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 28 Sep 2026 14:19:42 +0100 Subject: 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 --- runtime/lua/vim/treesitter/_range.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/lua/vim/treesitter/_range.lua') diff --git a/runtime/lua/vim/treesitter/_range.lua b/runtime/lua/vim/treesitter/_range.lua index 1526acb8aa..a754539f26 100644 --- a/runtime/lua/vim/treesitter/_range.lua +++ b/runtime/lua/vim/treesitter/_range.lua @@ -168,6 +168,8 @@ function M.add_bytes(source, range) return range --[[@as Range6]] end + -- EmmyLua incorrectly makes range nullable after the table check. + ---@cast range -nil local start_row, start_col, end_row, end_col = M.unpack4(range) -- TODO(vigoux): proper byte computation here, and account for EOL ? local start_byte = get_offset(source, start_row) + start_col -- cgit