aboutsummaryrefslogtreecommitdiffstats
path: root/tests/query/injection_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/query/injection_spec.lua')
-rw-r--r--tests/query/injection_spec.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/query/injection_spec.lua b/tests/query/injection_spec.lua
index 7efbab315..95ad12eec 100644
--- a/tests/query/injection_spec.lua
+++ b/tests/query/injection_spec.lua
@@ -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