Add tree-sitter-elm
This commit is contained in:
parent
e0915190d4
commit
a4914fcf3b
7 changed files with 98 additions and 0 deletions
11
crates/zed/src/languages/elm/config.toml
Normal file
11
crates/zed/src/languages/elm/config.toml
Normal file
|
@ -0,0 +1,11 @@
|
|||
name = "Elm"
|
||||
path_suffixes = ["elm"]
|
||||
line_comment = "-- "
|
||||
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 = ["string"] },
|
||||
{ start = "'", end = "'", close = true, newline = false, not_in = ["string", "comment"] },
|
||||
]
|
71
crates/zed/src/languages/elm/highlights.scm
Normal file
71
crates/zed/src/languages/elm/highlights.scm
Normal file
|
@ -0,0 +1,71 @@
|
|||
[
|
||||
"if"
|
||||
"then"
|
||||
"else"
|
||||
"let"
|
||||
"in"
|
||||
(case)
|
||||
(of)
|
||||
(backslash)
|
||||
(as)
|
||||
(port)
|
||||
(exposing)
|
||||
(alias)
|
||||
(import)
|
||||
(module)
|
||||
(type)
|
||||
] @keyword
|
||||
|
||||
[
|
||||
(arrow)
|
||||
(eq)
|
||||
(operator_identifier)
|
||||
(colon)
|
||||
] @operator
|
||||
|
||||
(type_annotation(lower_case_identifier) @function)
|
||||
(port_annotation(lower_case_identifier) @function)
|
||||
(function_declaration_left(lower_case_identifier) @function.definition)
|
||||
(function_call_expr target: (value_expr) @identifier)
|
||||
|
||||
(exposed_value(lower_case_identifier) @function)
|
||||
(exposed_type(upper_case_identifier) @type)
|
||||
|
||||
(field_access_expr(value_expr(value_qid)) @identifier)
|
||||
(lower_pattern) @variable
|
||||
(record_base_identifier) @identifier
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
"|"
|
||||
","
|
||||
] @punctuation.delimiter
|
||||
|
||||
(number_constant_expr) @constant
|
||||
|
||||
(type_declaration(upper_case_identifier) @type)
|
||||
(type_ref) @type
|
||||
(type_alias_declaration name: (upper_case_identifier) @type)
|
||||
|
||||
(union_variant(upper_case_identifier) @variant)
|
||||
(union_pattern) @variant
|
||||
(value_expr(upper_case_qid(upper_case_identifier)) @type)
|
||||
|
||||
[
|
||||
(line_comment)
|
||||
(block_comment)
|
||||
] @comment
|
||||
|
||||
(string_escape) @string.escape
|
||||
|
||||
[
|
||||
(open_quote)
|
||||
(close_quote)
|
||||
(regular_string_part)
|
||||
(open_char)
|
||||
(close_char)
|
||||
] @string
|
2
crates/zed/src/languages/elm/injections.scm
Normal file
2
crates/zed/src/languages/elm/injections.scm
Normal file
|
@ -0,0 +1,2 @@
|
|||
((glsl_content) @content
|
||||
(#set! "language" "glsl"))
|
Loading…
Add table
Add a link
Reference in a new issue