mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-21 17:06:18 +04:00
Add DTD language support (#6644)
- Added syntax highlighting for the DTD subset of the XML spec. - Included .dtd and .ent as common file extensions
This commit is contained in:
parent
fff8543b58
commit
161fef2166
@ -28,6 +28,7 @@
|
||||
| diff | ✓ | | | |
|
||||
| dockerfile | ✓ | | | `docker-langserver` |
|
||||
| dot | ✓ | | | `dot-language-server` |
|
||||
| dtd | ✓ | | | |
|
||||
| edoc | ✓ | | | |
|
||||
| eex | ✓ | | | |
|
||||
| ejs | ✓ | | | |
|
||||
|
@ -2099,6 +2099,26 @@ roots = []
|
||||
name = "xml"
|
||||
source = { git = "https://github.com/RenjiSann/tree-sitter-xml", rev = "48a7c2b6fb9d515577e115e6788937e837815651" }
|
||||
|
||||
|
||||
[[language]]
|
||||
name = "dtd"
|
||||
scope = "source.dtd"
|
||||
injection-regex = "dtd"
|
||||
file-types = ["dtd", "ent"]
|
||||
indent = {tab-width = 2, unit = " "}
|
||||
roots = []
|
||||
|
||||
[language.auto-pairs]
|
||||
'(' = ')'
|
||||
'[' = ']'
|
||||
'"' = '"'
|
||||
"'" = "'"
|
||||
'<' = '>'
|
||||
|
||||
[[grammar]]
|
||||
name = "dtd"
|
||||
source = { git = "https://github.com/KMikeeU/tree-sitter-dtd", rev = "6116becb02a6b8e9588ef73d300a9ba4622e156f"}
|
||||
|
||||
[[language]]
|
||||
name = "wit"
|
||||
scope = "source.wit"
|
||||
|
39
runtime/queries/dtd/highlights.scm
Normal file
39
runtime/queries/dtd/highlights.scm
Normal file
@ -0,0 +1,39 @@
|
||||
; highlights.scm
|
||||
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
"ELEMENT"
|
||||
"ATTLIST"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"#REQUIRED"
|
||||
"#IMPLIED"
|
||||
"#FIXED"
|
||||
"#PCDATA"
|
||||
] @keyword.directive
|
||||
|
||||
[
|
||||
"EMPTY"
|
||||
"ANY"
|
||||
"SYSTEM"
|
||||
"PUBLIC"
|
||||
] @constant
|
||||
|
||||
(element_name) @module
|
||||
|
||||
|
||||
(attribute_name) @attribute
|
||||
|
||||
(system_literal) @string
|
||||
(pubid_literal) @string
|
||||
(attribute_value) @string
|
||||
|
||||
[
|
||||
">"
|
||||
"</"
|
||||
"<?"
|
||||
"?>"
|
||||
"<!"
|
||||
] @punctuation.bracket
|
2
runtime/queries/dtd/injections.scm
Normal file
2
runtime/queries/dtd/injections.scm
Normal file
@ -0,0 +1,2 @@
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
Loading…
Reference in New Issue
Block a user