aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2023-02-05 21:31:30 +0000
committerGitHub <noreply@github.com>2023-02-05 21:31:30 +0000
commit7963a160e90f9ded63db1dfa24e607ee70af18ba (patch)
treec392a7df8678f8b026882b641038609d6a2adb74 /runtime/doc
parent23e34fe534d201a1323ab040cb2201d21fe865cc (diff)
parent4c66f5ff97a52fbc933fdbe1907c4b960d5a7403 (diff)
downloadrneovim-7963a160e90f9ded63db1dfa24e607ee70af18ba.tar.gz
rneovim-7963a160e90f9ded63db1dfa24e607ee70af18ba.tar.bz2
rneovim-7963a160e90f9ded63db1dfa24e607ee70af18ba.zip
Merge pull request #21548 from figsoda/transform-capture
feat(treesitter): allow capture text to be transformed
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/news.txt6
-rw-r--r--runtime/doc/treesitter.txt3
2 files changed, 9 insertions, 0 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 5c234677ef..b438595b5f 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -151,6 +151,12 @@ The following new APIs or features were added.
• |:highlight| now supports an additional attribute "altfont".
+• 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)