feat(lang): add xml (#4518)

This commit is contained in:
Matthew Toohey 2022-10-29 16:41:28 -04:00 committed by GitHub
parent 2935e9da19
commit f054a3f3ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 0 deletions

View File

@ -127,5 +127,6 @@
| wat | ✓ | | | |
| wgsl | ✓ | | | `wgsl_analyzer` |
| xit | ✓ | | | |
| xml | ✓ | | ✓ | |
| yaml | ✓ | | ✓ | `yaml-language-server` |
| zig | ✓ | ✓ | ✓ | `zls` |

View File

@ -1897,3 +1897,23 @@ injection-regex = "kdl"
[[grammar]]
name = "kdl"
source = { git = "https://github.com/Unoqwy/tree-sitter-kdl", rev = "e1cd292c6d15df6610484e1d4b5c987ecad52373" }
[[language]]
name = "xml"
scope = "source.xml"
injection-regex = "xml"
file-types = ["xml"]
indent = { tab-width = 2, unit = " " }
roots = []
[language.auto-pairs]
'(' = ')'
'{' = '}'
'[' = ']'
'"' = '"'
"'" = "'"
"<" = ">"
[[grammar]]
name = "xml"
source = { git = "https://github.com/RenjiSann/tree-sitter-xml", rev = "422528a43630db6dcc1e222d1c5ee3babd559473" }

View File

@ -0,0 +1,42 @@
(comment) @comment
[
"DOCTYPE"
"ELEMENT"
"ATTLIST"
] @keyword
[
"#REQUIRED"
"#IMPLIED"
"#FIXED"
"#PCDATA"
] @keyword.directive
[
"EMPTY"
"ANY"
"SYSTEM"
"PUBLIC"
] @constant
(doctype) @variable
(element_name) @variable
"xml" @tag
(tag_name) @tag
[
"encoding"
"version"
"standalone"
] @attribute
(attribute_name) @attribute
(system_literal) @string
(pubid_literal) @string
(attribute_value) @string
[
"<" ">" "</" "/>" "<?" "?>" "<!"
] @punctuation.bracket

View File

@ -0,0 +1 @@
(element) @indent

View File

@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))