feat(lang): add xml (#4518)
This commit is contained in:
parent
2935e9da19
commit
f054a3f3ed
5 changed files with 66 additions and 0 deletions
|
@ -127,5 +127,6 @@
|
|||
| wat | ✓ | | | |
|
||||
| wgsl | ✓ | | | `wgsl_analyzer` |
|
||||
| xit | ✓ | | | |
|
||||
| xml | ✓ | | ✓ | |
|
||||
| yaml | ✓ | | ✓ | `yaml-language-server` |
|
||||
| zig | ✓ | ✓ | ✓ | `zls` |
|
||||
|
|
|
@ -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" }
|
||||
|
|
42
runtime/queries/xml/highlights.scm
Normal file
42
runtime/queries/xml/highlights.scm
Normal 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
|
1
runtime/queries/xml/indents.scm
Normal file
1
runtime/queries/xml/indents.scm
Normal file
|
@ -0,0 +1 @@
|
|||
(element) @indent
|
2
runtime/queries/xml/injections.scm
Normal file
2
runtime/queries/xml/injections.scm
Normal file
|
@ -0,0 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
Loading…
Add table
Reference in a new issue