feat(lang): add xml (#4518)

pull/4528/head
Matthew Toohey 2 years ago committed by GitHub
parent 2935e9da19
commit f054a3f3ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

@ -1897,3 +1897,23 @@ injection-regex = "kdl"
[[grammar]] [[grammar]]
name = "kdl" name = "kdl"
source = { git = "https://github.com/Unoqwy/tree-sitter-kdl", rev = "e1cd292c6d15df6610484e1d4b5c987ecad52373" } 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" }

@ -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

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

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