aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter/query.lua
diff options
context:
space:
mode:
authorThomas Vigouroux <tomvig38@gmail.com>2020-09-04 14:27:15 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2020-09-04 15:24:23 +0200
commit3fd6e3b923402c2d513068a25d6425d040c5012b (patch)
tree3b6c160cd0bf802036b329dbfea5d9e2770b2616 /runtime/lua/vim/treesitter/query.lua
parent3acfefb63ee70c8eac13bf6b308a0e73e6fb8007 (diff)
downloadrneovim-3fd6e3b923402c2d513068a25d6425d040c5012b.tar.gz
rneovim-3fd6e3b923402c2d513068a25d6425d040c5012b.tar.bz2
rneovim-3fd6e3b923402c2d513068a25d6425d040c5012b.zip
treesitter: allow to list supported predicates
Diffstat (limited to 'runtime/lua/vim/treesitter/query.lua')
-rw-r--r--runtime/lua/vim/treesitter/query.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua
index 803b9edbf0..55e69f177f 100644
--- a/runtime/lua/vim/treesitter/query.lua
+++ b/runtime/lua/vim/treesitter/query.lua
@@ -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