aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-08-22 00:51:38 -0400
committerChristian Clason <c.clason@uni-graz.at>2023-08-24 09:05:44 +0900
commitc6ec7fa8d741d6301701067ecd095bf02e7a741a (patch)
treeaf5ef153b6f27bf67e70d2ed74a55eccf85071f2 /runtime/doc
parent466c18b8185c44f4fbf67ae91a2ffe27c1919306 (diff)
downloadrneovim-c6ec7fa8d741d6301701067ecd095bf02e7a741a.tar.gz
rneovim-c6ec7fa8d741d6301701067ecd095bf02e7a741a.tar.bz2
rneovim-c6ec7fa8d741d6301701067ecd095bf02e7a741a.zip
feat(treesitter): add 'injection.self' and 'injection.parent'
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/news.txt2
-rw-r--r--runtime/doc/treesitter.txt4
2 files changed, 6 insertions, 0 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 483e829770..82b390853c 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -131,6 +131,8 @@ The following new APIs and features were added.
• `@injection.language` now has smarter resolution and will now fallback to language aliases and/or attempt lower case variants of the text.
language via aliases (e.g., filetype) registered via
`vim.treesitter.language.register`.
+ • The `#set!` directive now supports `injection.self` and `injection.parent` for injecting either the current node's language
+ or the parent LanguageTree's language, respectively.
• |vim.ui.open()| opens URIs using the system default handler (macOS `open`,
Windows `explorer`, Linux `xdg-open`, etc.)
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index f3e697807f..139b986786 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -523,6 +523,10 @@ associated with patterns:
node's entire text should be re-parsed, including the text of its child
nodes. By default, child nodes' text will be excluded from the injected
document.
+ • `injection.self` - indicates that the node's text should be parsed with
+ the same language as the node's LanguageTree.
+ • `injection.parent` - indicates that the captured node’s text should
+ be parsed with the same language as the node's parent LanguageTree.
==============================================================================
VIM.TREESITTER *lua-treesitter*