nvim-treesitter/queries/xml/highlights.scm
Christian Clason 99ddf57353
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.
2024-03-03 11:00:11 +01:00

66 lines
827 B
Scheme

; inherits: dtd
; XML declaration
(XMLDecl
"standalone" @tag.attribute)
(XMLDecl
[
"yes"
"no"
] @boolean)
; Processing instructions
(XmlModelPI
"xml-model" @keyword.directive)
(StyleSheetPI
"xml-stylesheet" @keyword.directive)
(PseudoAtt
(Name) @tag.attribute)
(PseudoAtt
(PseudoAttValue) @string)
; Doctype declaration
(doctypedecl
"DOCTYPE" @keyword.directive.define)
(doctypedecl
(Name) @type.definition)
; Tags
(STag
(Name) @tag)
(ETag
(Name) @tag)
(EmptyElemTag
(Name) @tag)
; Attributes
(Attribute
(Name) @tag.attribute)
(Attribute
(AttValue) @string)
; Text
(CharData) @none @spell
((CDSect
(CDStart) @module
(CData) @markup.raw
"]]>" @module)
(#set! "priority" 105))
; Delimiters & punctuation
[
"<"
"</"
"/>"
] @tag.delimiter
"]" @punctuation.bracket