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

@@ -127,6 +127,11 @@ function M.add_predicate(name, handler, force)
predicate_handlers[name] = handler
end
--- Returns the list of currently supported predicates
function M.list_predicates()
return vim.tbl_keys(predicate_handlers)
end
function Query:match_preds(match, pattern, bufnr)
local preds = self.info.patterns[pattern]
if not preds then