From 2db6d378e873de31d18ade549c2edba64ff1c2e3 Mon Sep 17 00:00:00 2001 From: LeoBarreiro Date: Sun, 17 Nov 2024 18:40:06 -0300 Subject: [PATCH] fix(106): iter_matches backwards compatibility for nightly --- lua/refactoring/refactor/106.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/refactoring/refactor/106.lua b/lua/refactoring/refactor/106.lua index 87aef8a1..785e070d 100644 --- a/lua/refactoring/refactor/106.lua +++ b/lua/refactoring/refactor/106.lua @@ -499,7 +499,14 @@ local function extract_setup(refactor) local body_sexpr = "(" .. table.concat(body_sexprs, " . ") .. ")" local query = vim.treesitter.query.parse(lang, body_sexpr) - for _, match in query:iter_matches(refactor.root, refactor.bufnr, 0, -1) do + local matches = query:iter_matches( + refactor.root, + refactor.bufnr, + 0, + -1, + { all = false } + ) + for _, match in matches do if match then local first = match[1] --[[@as TSNode]] local last = match[#match] --[[@as TSNode]]