From 734efe8a2682b6415712933efd19c484c2f8d942 Mon Sep 17 00:00:00 2001 From: Ankit Goel Date: Sun, 2 Apr 2023 22:04:47 +0100 Subject: [PATCH] fix(treesitter): use query.parse (#226) --- lua/neotest/lib/treesitter/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/neotest/lib/treesitter/init.lua b/lua/neotest/lib/treesitter/init.lua index 77e81f40..242be8a4 100644 --- a/lua/neotest/lib/treesitter/init.lua +++ b/lua/neotest/lib/treesitter/init.lua @@ -100,7 +100,8 @@ end ---@return table function neotest.lib.treesitter.normalise_query(lang, query) if type(query) == "string" then - query = vim.treesitter.parse_query(lang, query) + local parse_query = vim.treesitter.query.parse or vim.treesitter.parse_query + query = parse_query(lang, query) end return query end