treesitter: allow to list supported predicates

This commit is contained in:
Thomas Vigouroux
2020-09-04 14:27:15 +02:00
parent 3acfefb63e
commit 3fd6e3b923
3 changed files with 22 additions and 0 deletions

View File

@@ -312,6 +312,18 @@ void ui_refresh(void)
]], custom_query)
eq({{0, 4, 0, 8}}, res)
local res_list = exec_lua[[
local query = require'vim.treesitter.query'
local list = query.list_predicates()
table.sort(list)
return list
]]
eq({ 'contains?', 'eq?', 'is-main?', 'match?', 'vim-match?' }, res_list)
end)
it('supports highlighting', function()