Use standard injection.language and injection.content captures (#22268)

Closes #9656. Continuation of #9654, but with the addition of backwards
compatibility for the existing captures.

Release Notes:

- Improved Tree-sitter support with added compatibility for standard
injections captures

---------

Co-authored-by: Finn Evers <finn.evers@outlook.de>
This commit is contained in:
uncenter 2025-01-07 13:17:49 -05:00 committed by GitHub
parent f3e75d8ff6
commit d58f006498
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 181 additions and 159 deletions

View file

@ -1,14 +1,14 @@
(fenced_code_block
(info_string
(language) @language)
(code_fence_content) @content)
(language) @injection.language)
(code_fence_content) @injection.content)
((inline) @content
(#set! "language" "markdown-inline"))
((inline) @injection.content
(#set! injection.language "markdown-inline"))
((html_block) @content
(#set! "language" "html"))
((html_block) @injection.content
(#set! injection.language "html"))
((minus_metadata) @content (#set! "language" "yaml"))
((minus_metadata) @injection.content (#set! injection.language "yaml"))
((plus_metadata) @content (#set! "language" "toml"))
((plus_metadata) @injection.content (#set! injection.language "toml"))