mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
test: fix tests broken after 0.10 update (#6714)
This commit is contained in:
parent
b7d50e59b1
commit
f9773e4a5e
4 changed files with 20 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue