test: fix tests broken after 0.10 update (#6714)

This commit is contained in:
Riley Bruins 2024-05-31 20:33:56 -07:00 committed by GitHub
parent b7d50e59b1
commit f9773e4a5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 19 deletions

View file

@ -1,5 +1,4 @@
require "nvim-treesitter.highlight" -- yes, this is necessary to set the hlmap
local highlighter = require "vim.treesitter.highlighter"
local configs = require "nvim-treesitter.configs"
local parsers = require "nvim-treesitter.parsers"
local ts = vim.treesitter
@ -21,8 +20,8 @@ local function check_assertions(file)
)
local parser = parsers.get_parser(buf, lang)
local self = highlighter.new(parser, {})
local top_level_root = parser:parse()[1]:root()
local self = parser
local top_level_root = parser:parse(true)[1]:root()
for _, assertion in ipairs(assertions) do
local row = assertion.position.row
@ -32,7 +31,7 @@ local function check_assertions(file)
assertion.expected_capture_name = neg_assert and assertion.expected_capture_name:sub(2)
or assertion.expected_capture_name
local found = false
self.tree:for_each_tree(function(tstree, tree)
self:for_each_tree(function(tstree, tree)
if not tstree then
return
end