diff options
| author | Lewis Russell <lewis6991@gmail.com> | 2026-09-28 14:19:42 +0100 |
|---|---|---|
| committer | Lewis Russell <lewis6991@gmail.com> | 2026-09-28 14:43:14 +0100 |
| commit | c6535538f8717a8f6134020a5bee65341cf8280f (patch) | |
| tree | a3c7512c9b98a571744d49ca6ff7f8c6568d373e /runtime/lua/vim/treesitter/_select.lua | |
| parent | b597af006fbb7c94c03ea9e7fa13cab7394b0501 (diff) | |
| download | rneovim-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/treesitter/_select.lua')
| -rw-r--r-- | runtime/lua/vim/treesitter/_select.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/lua/vim/treesitter/_select.lua b/runtime/lua/vim/treesitter/_select.lua index c1fb110dd0..47a83b46da 100644 --- a/runtime/lua/vim/treesitter/_select.lua +++ b/runtime/lua/vim/treesitter/_select.lua @@ -164,6 +164,7 @@ local function get_node(range, top_node, parent_chain) for _, child_tree in ipairs(child:trees()) do for _, child_region in ipairs(tree_get_ranges(child_tree)) do local child_root_node_range = { child_tree:root():range() } + --- @cast child_root_node_range Range4 local child_range = Range.intersection(child_region, child_root_node_range) local child_top_node = create_top_node(child_tree, child_region, child) @@ -299,6 +300,7 @@ local function node_get_children_no_normalize(node) for _, child_tree in ipairs(child:trees()) do for _, child_region in ipairs(tree_get_ranges(child_tree)) do local child_root_node_range = { child_tree:root():range() } + --- @cast child_root_node_range Range4 local child_range = Range.intersection(child_region, child_root_node_range) if child_range and Range.contains(node_range(node), child_range) then @@ -352,7 +354,6 @@ local function get_selection() local pos1 = vim.fn.getpos('v') local pos2 = vim.fn.getpos('.') if pos1[2] > pos2[2] or (pos1[2] == pos2[2] and pos1[3] > pos2[3]) then - --- @type Range4,Range4 pos1, pos2 = pos2, pos1 end |