From 8a5582f67fb8db81da90be8298922579f2fb2a08 Mon Sep 17 00:00:00 2001 From: Vladimir Sushkov Date: Mon, 13 Oct 2025 23:19:40 +0300 Subject: [PATCH] add parse before for_each_tree --- lua/nvim-treesitter/query.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/nvim-treesitter/query.lua b/lua/nvim-treesitter/query.lua index 4aba9f2fd..808a09324 100644 --- a/lua/nvim-treesitter/query.lua +++ b/lua/nvim-treesitter/query.lua @@ -437,6 +437,7 @@ function M.get_capture_matches_recursively(bufnr, capture_or_fn, query_type) local matches = {} if parser then + parser:parse(false) parser:for_each_tree(function(tree, lang_tree) local lang = lang_tree:lang() local capture, type_ = type_fn(lang, tree, lang_tree)