mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
Merge pull request #12847 from nvim-treesitter/ts-list-predicates
treesitter: allow to list supported predicates
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user