on master help sign in
Add DTD language support (#6644)
161fef2Michael
book/src/generated/lang-support.md+1
@@ -28,6 +28,7 @@
28| diff | ✓ | | | |
28| diff | ✓ | | | |
29| dockerfile | ✓ | | | `docker-langserver` |
29| dockerfile | ✓ | | | `docker-langserver` |
30| dot | ✓ | | | `dot-language-server` |
30| dot | ✓ | | | `dot-language-server` |
31+| dtd | ✓ | | | |
31| edoc | ✓ | | | |
32| edoc | ✓ | | | |
32| eex | ✓ | | | |
33| eex | ✓ | | | |
33| ejs | ✓ | | | |
34| ejs | ✓ | | | |
languages.toml+20
@@ -2099,6 +2099,26 @@ roots = []
2099name = "xml"
2099name = "xml"
2100source = { git = "https://github.com/RenjiSann/tree-sitter-xml", rev = "48a7c2b6fb9d515577e115e6788937e837815651" }
2100source = { git = "https://github.com/RenjiSann/tree-sitter-xml", rev = "48a7c2b6fb9d515577e115e6788937e837815651" }
2101
2101
2102+
2103+[[language]]
2104+name = "dtd"
2105+scope = "source.dtd"
2106+injection-regex = "dtd"
2107+file-types = ["dtd", "ent"]
2108+indent = {tab-width = 2, unit = " "}
2109+roots = []
2110+
2111+[language.auto-pairs]
2112+'(' = ')'
2113+'[' = ']'
2114+'"' = '"'
2115+"'" = "'"
2116+'<' = '>'
2117+
2118+[[grammar]]
2119+name = "dtd"
2120+source = { git = "https://github.com/KMikeeU/tree-sitter-dtd", rev = "6116becb02a6b8e9588ef73d300a9ba4622e156f"}
2121+
2102[[language]]
2122[[language]]
2103name = "wit"
2123name = "wit"
2104scope = "source.wit"
2124scope = "source.wit"
runtime/queries/dtd/highlights.scmnew file+39
@@ -0,0 +1,39 @@
1+; highlights.scm
2+
3+(comment) @comment
4+
5+[
6+ "ELEMENT"
7+ "ATTLIST"
8+] @keyword
9+
10+[
11+ "#REQUIRED"
12+ "#IMPLIED"
13+ "#FIXED"
14+ "#PCDATA"
15+] @keyword.directive
16+
17+[
18+ "EMPTY"
19+ "ANY"
20+ "SYSTEM"
21+ "PUBLIC"
22+] @constant
23+
24+(element_name) @module
25+
26+
27+(attribute_name) @attribute
28+
29+(system_literal) @string
30+(pubid_literal) @string
31+(attribute_value) @string
32+
33+[
34+ ">"
35+ "</"
36+ "<?"
37+ "?>"
38+ "<!"
39+] @punctuation.bracket
runtime/queries/dtd/injections.scmnew file+2
@@ -0,0 +1,2 @@
1+((comment) @injection.content
2+ (#set! injection.language "comment"))