aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2022-12-26 16:10:59 -0500
committerfigsoda <figsoda@pm.me>2023-02-04 21:15:03 -0500
commite1d5ad1cb87d43c3d75619e239312d4ab2029b45 (patch)
tree0c78fa9ab99125dd5e44eac3204b35ace115bc67 /runtime/doc
parentbb8845340b1b9c2180fb19f049ff9deff5857d99 (diff)
downloadrneovim-e1d5ad1cb87d43c3d75619e239312d4ab2029b45.tar.gz
rneovim-e1d5ad1cb87d43c3d75619e239312d4ab2029b45.tar.bz2
rneovim-e1d5ad1cb87d43c3d75619e239312d4ab2029b45.zip
feat(treesitter): add metadata option for get_node_text
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/news.txt3
-rw-r--r--runtime/doc/treesitter.txt3
2 files changed, 6 insertions, 0 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 7c3f295560..b438595b5f 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -154,6 +154,9 @@ The following new APIs or features were added.
• Treesitter captures can now be transformed by directives. This will allow
more complicated dynamic language injections.
+• |vim.treesitter.query.get_node_text()| now accepts a `metadata` option for
+ writing custom directives using |vim.treesitter.query.add_directive()|.
+
==============================================================================
CHANGED FEATURES *news-changes*
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 7bc9f3f9a7..693804497d 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -746,6 +746,9 @@ get_node_text({node}, {source}, {opts})
• {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.query.add_directive()|.
Return: ~
(string[]|string|nil)