aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2023-03-10 16:10:05 +0000
committerLewis Russell <lewis6991@gmail.com>2023-03-10 16:35:06 +0000
commit9d70fe062ca01ac0673faa6ccbb88345916aeea7 (patch)
tree8b4db135bc63d7055185c808624f7555f96bc059 /runtime/doc
parent845efb8e12cb014b385deac62fb83622a99024ec (diff)
downloadrneovim-9d70fe062ca01ac0673faa6ccbb88345916aeea7.tar.gz
rneovim-9d70fe062ca01ac0673faa6ccbb88345916aeea7.tar.bz2
rneovim-9d70fe062ca01ac0673faa6ccbb88345916aeea7.zip
feat(treesitter)!: consolidate query util functions
- And address more type errors. - Removed the `concat` option from `get_node_text` since it was applied inconsistently and made typing awkward.
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/treesitter.txt17
1 files changed, 14 insertions, 3 deletions
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index c7a0e1927b..dc577a015e 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -789,14 +789,12 @@ get_node_text({node}, {source}, {opts})
• {source} (integer|string) Buffer or string from which the {node} is
extracted
• {opts} (table|nil) Optional parameters.
- • concat: (boolean) Concatenate result in a string (default
- true)
• metadata (table) Metadata of a specific capture. This
would be set to `metadata[capture_id]` when using
|vim.treesitter.add_directive()|.
Return: ~
- (string[]|string|nil)
+ (string)
get_query({lang}, {query_name}) *vim.treesitter.get_query()*
Returns the runtime query {query_name} for {lang}.
@@ -822,6 +820,19 @@ get_query_files({lang}, {query_name}, {is_included})
string[] query_files List of files to load for given query and
language
+get_range({node}, {source}, {metadata}) *vim.treesitter.get_range()*
+ Get the range of a |TSNode|. Can also supply {source} and {metadata} to
+ get the range with directives applied.
+
+ Parameters: ~
+ • {node} |TSNode|
+ • {source} integer|string|nil Buffer or string from which the {node}
+ is extracted
+ • {metadata} TSMetadata|nil
+
+ Return: ~
+ (table)
+
list_directives() *vim.treesitter.list_directives()*
Lists the currently available directives to use in queries.