diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2021-07-26 18:48:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-26 18:48:15 +0200 |
commit | 0e22a40b6d328ac4aa07ed7bc40da200a48ef524 (patch) | |
tree | fae2097bf903a93f3e8ef75f20ca7e37dcf29386 | |
parent | 1637622db9dd9ea7c9679a1a5e1367100f26dcf5 (diff) | |
parent | 5c42e2a87f41815980b380f9d83ec0144ff9bd90 (diff) | |
download | rneovim-0e22a40b6d328ac4aa07ed7bc40da200a48ef524.tar.gz rneovim-0e22a40b6d328ac4aa07ed7bc40da200a48ef524.tar.bz2 rneovim-0e22a40b6d328ac4aa07ed7bc40da200a48ef524.zip |
Merge pull request #15191 from vigoux/ts-docs
docs(ts): add documentation for listing fns
-rw-r--r-- | runtime/doc/treesitter.txt | 15 | ||||
-rw-r--r-- | runtime/lua/vim/treesitter/query.lua | 4 |
2 files changed, 11 insertions, 8 deletions
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index cabcb67921..5ddc0394cd 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -433,8 +433,13 @@ get_query_files({lang}, {query_name}, {is_included}) {is_included} Internal parameter, most of the time left as `nil` +list_directives() *list_directives()* + Return: ~ + The list of supported directives. + list_predicates() *list_predicates()* - TODO: Documentation + Return: ~ + The list of supported predicates. parse_query({lang}, {query}) *parse_query()* Parse {query} as a string. (If the query is in a file, the @@ -514,11 +519,9 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop}) for id, node in pairs(match) do local name = query.captures[id] -- `node` was captured by the `name` capture in the match -< -> - local node_data = metadata[id] -- Node level metadata -< -> + + local node_data = metadata[id] -- Node level metadata + ... use the info here ... end end diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua index 0ba44ced1a..4ecd91d295 100644 --- a/runtime/lua/vim/treesitter/query.lua +++ b/runtime/lua/vim/treesitter/query.lua @@ -351,12 +351,12 @@ function M.add_directive(name, handler, force) directive_handlers[name] = handler end ---- Returns the list of currently supported directives +--- @return The list of supported directives. function M.list_directives() return vim.tbl_keys(directive_handlers) end ---- Returns the list of currently supported predicates +--- @return The list of supported predicates. function M.list_predicates() return vim.tbl_keys(predicate_handlers) end |