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