feat(treesitter): add 'injection.self' and 'injection.parent'

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
This commit is contained in:
Amaan Qureshi
2023-08-22 00:51:38 -04:00
committed by Christian Clason
parent 466c18b818
commit c6ec7fa8d7
4 changed files with 47 additions and 3 deletions

View File

@@ -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.)

View File

@@ -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 nodes text should
be parsed with the same language as the node's parent LanguageTree.
==============================================================================
VIM.TREESITTER *lua-treesitter*