feat(highlights)!: enforce documented captures (#6232)

Problem: Allowing undocumented "secret" (sub)captures makes it harder
to write comprehensive colorschemes and catch inconsistent captures.

Solution: Only allow captures listed in CONTRIBUTING.md. Add useful
(cross-language) subcaptures and drop language-specific or too niche
ones.

Follow-up: Adding further `*.builtin` captures and changing queries to
use them.

Language-specific subcaptures should instead be added in user config or
a custom language plugin.
This commit is contained in:
Christian Clason 2024-03-03 11:00:11 +01:00 committed by GitHub
parent 22c5a0d833
commit 99ddf57353
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 108 additions and 112 deletions

View file

@ -41,15 +41,7 @@
(body
(arguments) @injection.language
(content) @injection.content))
(#any-of? @_type "code" "code-block" "sourcecode"))
((directive
name: (type) @_type
body:
(body
(arguments) @injection.language
(content) @injection.content))
(#eq? @_type "raw"))
(#any-of? @_type "raw" "code" "code-block" "sourcecode"))
((directive
name: (type) @_type
@ -59,7 +51,6 @@
(#set! injection.language "latex")
(#eq? @_type "math"))
; TODO: re-add when a parser for csv is added.
((directive
name: (type) @_type
body: