@@ -84,7 +84,7 @@ local get_query_matches = memoize(function(bufnr, query_group, root, root_lang)
84
84
if query_name ~= nil then
85
85
local path = vim .split (query_name , " %." )
86
86
for _ , node in ipairs (nodes ) do
87
- insert_to_path (prepared_match , path , { node : range ( true ) } )
87
+ insert_to_path (prepared_match , path , node )
88
88
end
89
89
end
90
90
end
@@ -143,8 +143,8 @@ local function get_capture_ranges_recursively(bufnr, query_string, query_group)
143
143
for _ , match in pairs (matches ) do
144
144
local found = get_at_path (match , query_string )
145
145
if found then
146
- --- @cast found Range6
147
- table.insert (ranges , found )
146
+ --- @cast found TSNode
147
+ table.insert (ranges , { found : range ( true ) } )
148
148
end
149
149
end
150
150
end )
@@ -178,7 +178,9 @@ function M.find_best_range(bufnr, capture_string, query_group, filter_predicate,
178
178
179
179
local matches = get_query_matches (bufnr , query_group , root , lang )
180
180
for _ , maybe_match in pairs (matches ) do
181
- local range = get_at_path (maybe_match , capture_string )
181
+ local node = get_at_path (maybe_match , capture_string )
182
+ --- @cast node TSNode
183
+ local range = { node :range (true ) }
182
184
--- @cast range Range6
183
185
184
186
if range and filter_predicate (range ) then
0 commit comments