Extract HTML support into an extension (#10130)
This PR extracts HTML support into an extension and removes the built-in HTML support from Zed. Release Notes: - Removed built-in support for HTML, in favor of making it available as an extension. The HTML extension will be suggested for download when you open a `.html`, `.htm`, or `.shtml` file.
This commit is contained in:
parent
256b446bdf
commit
49c53bc0ec
17 changed files with 133 additions and 145 deletions
2
extensions/html/languages/html/brackets.scm
Normal file
2
extensions/html/languages/html/brackets.scm
Normal file
|
@ -0,0 +1,2 @@
|
|||
("<" @open ">" @close)
|
||||
("\"" @open "\"" @close)
|
15
extensions/html/languages/html/config.toml
Normal file
15
extensions/html/languages/html/config.toml
Normal file
|
@ -0,0 +1,15 @@
|
|||
name = "HTML"
|
||||
grammar = "html"
|
||||
path_suffixes = ["html", "htm", "shtml"]
|
||||
autoclose_before = ">})"
|
||||
block_comment = ["<!-- ", " -->"]
|
||||
brackets = [
|
||||
{ start = "{", end = "}", close = true, newline = true },
|
||||
{ start = "[", end = "]", close = true, newline = true },
|
||||
{ start = "(", end = ")", close = true, newline = true },
|
||||
{ start = "\"", end = "\"", close = true, newline = false, not_in = ["comment", "string"] },
|
||||
{ start = "<", end = ">", close = true, newline = true, not_in = ["comment", "string"] },
|
||||
{ start = "!--", end = " --", close = true, newline = false, not_in = ["comment", "string"] },
|
||||
]
|
||||
word_characters = ["-"]
|
||||
prettier_parser_name = "html"
|
16
extensions/html/languages/html/highlights.scm
Normal file
16
extensions/html/languages/html/highlights.scm
Normal file
|
@ -0,0 +1,16 @@
|
|||
(tag_name) @keyword
|
||||
(erroneous_end_tag_name) @keyword
|
||||
(doctype) @constant
|
||||
(attribute_name) @property
|
||||
(attribute_value) @string
|
||||
(comment) @comment
|
||||
|
||||
"=" @operator
|
||||
|
||||
[
|
||||
"<"
|
||||
">"
|
||||
"<!"
|
||||
"</"
|
||||
"/>"
|
||||
] @punctuation.bracket
|
6
extensions/html/languages/html/indents.scm
Normal file
6
extensions/html/languages/html/indents.scm
Normal file
|
@ -0,0 +1,6 @@
|
|||
(start_tag ">" @end) @indent
|
||||
(self_closing_tag "/>" @end) @indent
|
||||
|
||||
(element
|
||||
(start_tag) @start
|
||||
(end_tag)? @end) @indent
|
7
extensions/html/languages/html/injections.scm
Normal file
7
extensions/html/languages/html/injections.scm
Normal file
|
@ -0,0 +1,7 @@
|
|||
(script_element
|
||||
(raw_text) @content
|
||||
(#set! "language" "javascript"))
|
||||
|
||||
(style_element
|
||||
(raw_text) @content
|
||||
(#set! "language" "css"))
|
0
extensions/html/languages/html/outline.scm
Normal file
0
extensions/html/languages/html/outline.scm
Normal file
2
extensions/html/languages/html/overrides.scm
Normal file
2
extensions/html/languages/html/overrides.scm
Normal file
|
@ -0,0 +1,2 @@
|
|||
(comment) @comment
|
||||
(quoted_attribute_value) @string
|
Loading…
Add table
Add a link
Reference in a new issue