treesitter: add query.list_directives

This commit is contained in:
Stephan Seitz
2021-04-11 20:53:52 +02:00
parent 46009499af
commit b2a9afef6d
3 changed files with 45 additions and 0 deletions

View File

@@ -646,6 +646,19 @@ int x = INT_MAX;
{2, 29, 2, 68} -- READ_STRING_OK(x, y) (char_u *)read_string((x), (size_t)(y))
}, get_ranges())
end)
it("should list all directives", function()
local res_list = exec_lua[[
local query = require'vim.treesitter.query'
local list = query.list_directives()
table.sort(list)
return list
]]
eq({ 'offset!', 'set!' }, res_list)
end)
end)
end)