From 6d3d22cdad49999ef774ebe1bc250a4994038964 Mon Sep 17 00:00:00 2001 From: Archil Karchava Date: Wed, 2 Oct 2024 23:25:11 +0400 Subject: [PATCH] fix(query): use `nil` to skip optional parameters when calling the iter_matches method (#458) --- lua/neotest/config/init.lua | 2 +- lua/neotest/lib/treesitter/init.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/neotest/config/init.lua b/lua/neotest/config/init.lua index 4ca0098..3125090 100644 --- a/lua/neotest/config/init.lua +++ b/lua/neotest/config/init.lua @@ -333,7 +333,7 @@ local default_config = { ]] ) local symbols = {} - for _, match, metadata in query:iter_matches(root, content, _, _, { all = false }) do + for _, match, metadata in query:iter_matches(root, content, nil, nil, { all = false }) do for id, node in pairs(match) do local name = query.captures[id] diff --git a/lua/neotest/lib/treesitter/init.lua b/lua/neotest/lib/treesitter/init.lua index d8d96c0..59bf4eb 100644 --- a/lua/neotest/lib/treesitter/init.lua +++ b/lua/neotest/lib/treesitter/init.lua @@ -56,7 +56,7 @@ local function collect(file_path, query, source, root, opts) range = { root:range() }, }, } - for _, match in query:iter_matches(root, source, _, _, { all = false }) do + for _, match in query:iter_matches(root, source, nil, nil, { all = false }) do local captured_nodes = {} for i, capture in ipairs(query.captures) do captured_nodes[capture] = match[i]