aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorYi Ming <ofseed@foxmail.com>2024-08-06 19:28:42 +0800
committerChristian Clason <c.clason@uni-graz.at>2024-08-06 18:18:34 +0200
commit0a1212ef94547f04db789a660639fab6837e00ce (patch)
tree64321422332dad8ce2038cec1d3ba861095b6c1e /runtime/doc
parentcc26cf0400286990d553bee993c9b113ca4cbc46 (diff)
downloadrneovim-0a1212ef94547f04db789a660639fab6837e00ce.tar.gz
rneovim-0a1212ef94547f04db789a660639fab6837e00ce.tar.bz2
rneovim-0a1212ef94547f04db789a660639fab6837e00ce.zip
docs(treesitter): generate inline docs for `Range`s
docs(treesitter): in-place parameter description docs(treesitter): remove internal type names docs(treesitter): add missing private annotation
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/treesitter.txt45
1 files changed, 37 insertions, 8 deletions
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 97f77c9e31..c8fc2743af 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -358,7 +358,8 @@ The following directives are built in:
<
`offset!` *treesitter-directive-offset!*
Takes the range of the captured node and applies an offset. This will
- set a new `Range4` object for the captured node with `capture_id` as
+ set a new range in the form of a list like { {start_row}, {start_col},
+ {end_row}, {end_col} } for the captured node with `capture_id` as
`metadata[capture_id].range`. Useful for |treesitter-language-injections|.
Parameters: ~
@@ -833,7 +834,13 @@ get_range({node}, {source}, {metadata}) *vim.treesitter.get_range()*
• {metadata} (`vim.treesitter.query.TSMetadata?`)
Return: ~
- (`Range6`)
+ (`table`) A table with the following fields:
+ • {[1]} (`integer`) start row
+ • {[2]} (`integer`) start column
+ • {[3]} (`integer`) start bytes
+ • {[4]} (`integer`) end row
+ • {[5]} (`integer`) end column
+ • {[6]} (`integer`) end bytes
*vim.treesitter.get_string_parser()*
get_string_parser({str}, {lang}, {opts})
@@ -1300,7 +1307,11 @@ LanguageTree:contains({range}) *LanguageTree:contains()*
Determines whether {range} is contained in the |LanguageTree|.
Parameters: ~
- • {range} (`Range4`) `{ start_line, start_col, end_line, end_col }`
+ • {range} (`table`) A table with the following fields:
+ • {[1]} (`integer`) start row
+ • {[2]} (`integer`) start column
+ • {[3]} (`integer`) end row
+ • {[4]} (`integer`) end column
Return: ~
(`boolean`)
@@ -1324,7 +1335,9 @@ LanguageTree:for_each_tree({fn}) *LanguageTree:for_each_tree()*
LanguageTree:included_regions() *LanguageTree:included_regions()*
Gets the set of included regions managed by this LanguageTree. This can be
different from the regions set by injection query, because a partial
- |LanguageTree:parse()| drops the regions outside the requested range.
+ |LanguageTree:parse()| drops the regions outside the requested range. Each
+ list represents a range in the form of { {start_row}, {start_col},
+ {start_bytes}, {end_row}, {end_col}, {end_bytes} }.
Return: ~
(`table<integer, Range6[]>`)
@@ -1359,7 +1372,11 @@ LanguageTree:language_for_range({range})
Gets the appropriate language that contains {range}.
Parameters: ~
- • {range} (`Range4`) `{ start_line, start_col, end_line, end_col }`
+ • {range} (`table`) A table with the following fields:
+ • {[1]} (`integer`) start row
+ • {[2]} (`integer`) start column
+ • {[3]} (`integer`) end row
+ • {[4]} (`integer`) end column
Return: ~
(`vim.treesitter.LanguageTree`) tree Managing {range}
@@ -1369,7 +1386,11 @@ LanguageTree:named_node_for_range({range}, {opts})
Gets the smallest named node that contains {range}.
Parameters: ~
- • {range} (`Range4`) `{ start_line, start_col, end_line, end_col }`
+ • {range} (`table`) A table with the following fields:
+ • {[1]} (`integer`) start row
+ • {[2]} (`integer`) start column
+ • {[3]} (`integer`) end row
+ • {[4]} (`integer`) end column
• {opts} (`table?`) A table with the following fields:
• {ignore_injections}? (`boolean`, default: `true`) Ignore
injected languages
@@ -1382,7 +1403,11 @@ LanguageTree:node_for_range({range}, {opts})
Gets the smallest node that contains {range}.
Parameters: ~
- • {range} (`Range4`) `{ start_line, start_col, end_line, end_col }`
+ • {range} (`table`) A table with the following fields:
+ • {[1]} (`integer`) start row
+ • {[2]} (`integer`) start column
+ • {[3]} (`integer`) end row
+ • {[4]} (`integer`) end column
• {opts} (`table?`) A table with the following fields:
• {ignore_injections}? (`boolean`, default: `true`) Ignore
injected languages
@@ -1443,7 +1468,11 @@ LanguageTree:tree_for_range({range}, {opts})
Gets the tree that contains {range}.
Parameters: ~
- • {range} (`Range4`) `{ start_line, start_col, end_line, end_col }`
+ • {range} (`table`) A table with the following fields:
+ • {[1]} (`integer`) start row
+ • {[2]} (`integer`) start column
+ • {[3]} (`integer`) end row
+ • {[4]} (`integer`) end column
• {opts} (`table?`) A table with the following fields:
• {ignore_injections}? (`boolean`, default: `true`) Ignore
injected languages