mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
doc: group documentation of predicates and directives
This commit is contained in:
parent
b2a9afef6d
commit
289c153d1f
@ -226,6 +226,18 @@ Here is a list of built-in predicates :
|
||||
Each predicate has a `not-` prefixed predicate that is just the negation of
|
||||
the predicate.
|
||||
|
||||
*vim.treesitter.query.add_predicate()*
|
||||
vim.treesitter.query.add_predicate({name}, {handler})
|
||||
|
||||
This adds a predicate with the name {name} to be used in queries.
|
||||
{handler} should be a function whose signature will be : >
|
||||
handler(match, pattern, bufnr, predicate)
|
||||
<
|
||||
*vim.treesitter.query.list_predicates()*
|
||||
vim.treesitter.query.list_predicates()
|
||||
|
||||
This lists the currently available predicates to use in queries.
|
||||
|
||||
Treesitter Query Directive *lua-treesitter-directives*
|
||||
|
||||
Treesitter queries can also contain `directives`. Directives store metadata for a node
|
||||
@ -249,18 +261,6 @@ Here is a list of built-in directives:
|
||||
`({capture_id}, {start_row}, {start_col}, {end_row}, {end_col}, {key?})`
|
||||
The default key is "offset".
|
||||
|
||||
*vim.treesitter.query.add_predicate()*
|
||||
vim.treesitter.query.add_predicate({name}, {handler})
|
||||
|
||||
This adds a predicate with the name {name} to be used in queries.
|
||||
{handler} should be a function whose signature will be : >
|
||||
handler(match, pattern, bufnr, predicate)
|
||||
<
|
||||
*vim.treesitter.query.list_predicates()*
|
||||
vim.treesitter.query.list_predicates()
|
||||
|
||||
This lists the currently available predicates to use in queries.
|
||||
|
||||
*vim.treesitter.query.add_directive()*
|
||||
vim.treesitter.query.add_directive({name}, {handler})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user