diff options
| author | Pham Huy Hoang <hoangtun0810@gmail.com> | 2024-01-06 15:05:50 +0900 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-01-19 16:58:37 +0100 |
| commit | 57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9 (patch) | |
| tree | 70bf645539882b88e6fa129cefd30986b89bbac3 /queries/xml | |
| parent | ci: add query lint job (diff) | |
| download | nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.gz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.bz2 nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.lz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.xz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.zst nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.zip | |
chore: query formatting
Diffstat (limited to 'queries/xml')
| -rw-r--r-- | queries/xml/highlights.scm | 72 | ||||
| -rw-r--r-- | queries/xml/injections.scm | 44 | ||||
| -rw-r--r-- | queries/xml/locals.scm | 38 |
3 files changed, 89 insertions, 65 deletions
diff --git a/queries/xml/highlights.scm b/queries/xml/highlights.scm index aa913352e..7881e0df0 100644 --- a/queries/xml/highlights.scm +++ b/queries/xml/highlights.scm @@ -1,53 +1,65 @@ ; inherits: dtd +; XML declaration +(XMLDecl + "standalone" @tag.attribute) -;; XML declaration +(XMLDecl + [ + "yes" + "no" + ] @boolean) -(XMLDecl "standalone" @tag.attribute) +; Processing instructions +(XmlModelPI + "xml-model" @keyword.directive) -(XMLDecl [ "yes" "no" ] @boolean) +(StyleSheetPI + "xml-stylesheet" @keyword.directive) -;; Processing instructions +(PseudoAtt + (Name) @tag.attribute) -(XmlModelPI "xml-model" @keyword.directive) +(PseudoAtt + (PseudoAttValue) @string) -(StyleSheetPI "xml-stylesheet" @keyword.directive) +; Doctype declaration +(doctypedecl + "DOCTYPE" @keyword.directive.define) -(PseudoAtt (Name) @tag.attribute) +(doctypedecl + (Name) @type.definition) -(PseudoAtt (PseudoAttValue) @string) +; Tags +(STag + (Name) @tag) -;; Doctype declaration +(ETag + (Name) @tag) -(doctypedecl "DOCTYPE" @keyword.directive.define) +(EmptyElemTag + (Name) @tag) -(doctypedecl (Name) @type.definition) +; Attributes +(Attribute + (Name) @tag.attribute) -;; Tags - -(STag (Name) @tag) - -(ETag (Name) @tag) - -(EmptyElemTag (Name) @tag) - -;; Attributes - -(Attribute (Name) @tag.attribute) - -(Attribute (AttValue) @string) - -;; Text +(Attribute + (AttValue) @string) +; Text (CharData) @none @spell ((CDSect (CDStart) @markup.environment (CData) @markup.raw "]]>" @markup.environment) - (#set! "priority" 105)) - -;; Delimiters & punctuation + (#set! "priority" 105)) -[ "<" "</" "/>" ] @tag.delimiter +; Delimiters & punctuation +[ + "<" + "</" + "/>" +] @tag.delimiter "]" @punctuation.bracket diff --git a/queries/xml/injections.scm b/queries/xml/injections.scm index 99b3a9cc8..942e54575 100644 --- a/queries/xml/injections.scm +++ b/queries/xml/injections.scm @@ -1,29 +1,31 @@ -((Comment) @injection.content - (#set! injection.language "comment")) - +((Comment) @injection.content + (#set! injection.language "comment")) ; SVG style ((element - (STag (Name) @_name) - (content) @injection.content) - (#eq? @_name "style") - (#set! injection.combined) - (#set! injection.include-children) - (#set! injection.language "css")) + (STag + (Name) @_name) + (content) @injection.content) + (#eq? @_name "style") + (#set! injection.combined) + (#set! injection.include-children) + (#set! injection.language "css")) ; SVG script ((element - (STag (Name) @_name) - (content) @injection.content) - (#eq? @_name "script") - (#set! injection.combined) - (#set! injection.include-children) - (#set! injection.language "javascript")) + (STag + (Name) @_name) + (content) @injection.content) + (#eq? @_name "script") + (#set! injection.combined) + (#set! injection.include-children) + (#set! injection.language "javascript")) ; phpMyAdmin dump ((element - (STag (Name) @_name) - (content) @injection.content) - (#eq? @_name "pma:table") - (#set! injection.combined) - (#set! injection.include-children) - (#set! injection.language "sql")) + (STag + (Name) @_name) + (content) @injection.content) + (#eq? @_name "pma:table") + (#set! injection.combined) + (#set! injection.include-children) + (#set! injection.language "sql")) diff --git a/queries/xml/locals.scm b/queries/xml/locals.scm index 214b43818..2806b530c 100644 --- a/queries/xml/locals.scm +++ b/queries/xml/locals.scm @@ -1,25 +1,35 @@ -;; tags - -(elementdecl (Name) @local.definition.type) +; tags +(elementdecl + (Name) @local.definition.type) (elementdecl (contentspec - (children (Name) @local.reference))) + (children + (Name) @local.reference))) -(AttlistDecl . (Name) @local.reference) +(AttlistDecl + . + (Name) @local.reference) -(STag (Name) @local.reference) -(ETag (Name) @local.reference) -(EmptyElemTag (Name) @local.reference) +(STag + (Name) @local.reference) -;; attributes +(ETag + (Name) @local.reference) -(AttDef (Name) @local.definition.field) +(EmptyElemTag + (Name) @local.reference) -(Attribute (Name) @local.reference) +; attributes +(AttDef + (Name) @local.definition.field) -;; entities +(Attribute + (Name) @local.reference) -(GEDecl (Name) @local.definition.macro) +; entities +(GEDecl + (Name) @local.definition.macro) -(EntityRef (Name) @local.reference) +(EntityRef + (Name) @local.reference) |
