diff --git a/lua/neotest/config/init.lua b/lua/neotest/config/init.lua index 2fc0d18..4ca0098 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) do + for _, match, metadata in query:iter_matches(root, content, _, _, { 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 7cb0136..d8d96c0 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) do + for _, match in query:iter_matches(root, source, _, _, { all = false }) do local captured_nodes = {} for i, capture in ipairs(query.captures) do captured_nodes[capture] = match[i]