mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test(treesitter): fix obsolete predicates
This commit is contained in:
parent
ba0370b1d7
commit
8ab9966939
@ -676,11 +676,11 @@ describe('treesitter highlighting (C)', function()
|
||||
local parser = vim.treesitter.get_parser(0, "c")
|
||||
test_hl = vim.treesitter.highlighter.new(parser, {queries = {c = [[
|
||||
("static" @keyword
|
||||
(set! conceal "R"))
|
||||
(#set! conceal "R"))
|
||||
|
||||
((identifier) @Identifier
|
||||
(set! conceal "")
|
||||
(eq? @Identifier "lstate"))
|
||||
(#set! conceal "")
|
||||
(#eq? @Identifier "lstate"))
|
||||
]]}})
|
||||
]=]
|
||||
|
||||
|
@ -174,7 +174,7 @@ void ui_refresh(void)
|
||||
end)
|
||||
|
||||
local test_query = [[
|
||||
((call_expression function: (identifier) @minfunc (argument_list (identifier) @min_id)) (eq? @minfunc "MIN"))
|
||||
((call_expression function: (identifier) @minfunc (argument_list (identifier) @min_id)) (#eq? @minfunc "MIN"))
|
||||
"for" @keyword
|
||||
(primitive_type) @type
|
||||
(field_expression argument: (identifier) @fieldarg)
|
||||
@ -886,7 +886,7 @@ end]]
|
||||
local parser = vim.treesitter.get_string_parser(str, "c")
|
||||
|
||||
local nodes = {}
|
||||
local query = vim.treesitter.query.parse("c", '((identifier) @id (eq? @id "foo"))')
|
||||
local query = vim.treesitter.query.parse("c", '((identifier) @id (#eq? @id "foo"))')
|
||||
|
||||
for _, node in query:iter_captures(parser:parse()[1]:root(), str) do
|
||||
table.insert(nodes, { node:range() })
|
||||
|
Loading…
Reference in New Issue
Block a user