mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 11:50:09 -04:00
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:
parent
22c5a0d833
commit
99ddf57353
29 changed files with 108 additions and 112 deletions
|
|
@ -41,16 +41,16 @@
|
|||
|
||||
; General environments
|
||||
(begin
|
||||
command: _ @markup.environment
|
||||
command: _ @module
|
||||
name:
|
||||
(curly_group_text
|
||||
(text) @markup.environment.name))
|
||||
(text) @label))
|
||||
|
||||
(end
|
||||
command: _ @markup.environment
|
||||
command: _ @module
|
||||
name:
|
||||
(curly_group_text
|
||||
(text) @markup.environment.name))
|
||||
(text) @label))
|
||||
|
||||
; Definitions and references
|
||||
(new_command_definition
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
command: _ @function.macro
|
||||
name:
|
||||
(curly_group_text
|
||||
(_) @markup.environment.name))
|
||||
(_) @label))
|
||||
|
||||
(paired_delimiter_definition
|
||||
command: _ @function.macro
|
||||
|
|
@ -260,8 +260,8 @@
|
|||
(begin
|
||||
name:
|
||||
(curly_group_text
|
||||
(text) @markup.environment.name)
|
||||
(#any-of? @markup.environment.name "frame"))
|
||||
(text) @label)
|
||||
(#any-of? @label "frame"))
|
||||
.
|
||||
(curly_group
|
||||
(_) @markup.heading))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue