Extract Elm language into an extension (#10432)

Release Notes:

- Extracted Elm language support into an extension

Co-authored-by: Marshall <marshall@zed.dev>
This commit is contained in:
Max Brunsfeld 2024-04-11 10:23:49 -07:00 committed by GitHub
parent 78d6beee80
commit bcd2ca6196
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 155 additions and 18 deletions

View file

@ -41,7 +41,6 @@ tree-sitter-c.workspace = true
tree-sitter-cpp.workspace = true
tree-sitter-css.workspace = true
tree-sitter-elixir.workspace = true
tree-sitter-elm.workspace = true
tree-sitter-embedded-template.workspace = true
tree-sitter-glsl.workspace = true
tree-sitter-go.workspace = true

View file

@ -1,12 +0,0 @@
name = "Elm"
grammar = "elm"
path_suffixes = ["elm"]
line_comments = ["-- "]
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"] },
]

View file

@ -1,72 +0,0 @@
[
"if"
"then"
"else"
"let"
"in"
(case)
(of)
(backslash)
(as)
(port)
(exposing)
(alias)
(import)
(module)
(type)
(arrow)
] @keyword
[
(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
name: (value_qid (lower_case_identifier) @function)))
(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)
(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

View file

@ -1,2 +0,0 @@
((glsl_content) @content
(#set! "language" "glsl"))

View file

@ -1,22 +0,0 @@
(type_declaration
(type) @context
(upper_case_identifier) @name) @item
(type_alias_declaration
(type) @context
(alias) @context
name: (upper_case_identifier) @name) @item
(type_alias_declaration
typeExpression:
(type_expression
part: (record_type
(field_type
name: (lower_case_identifier) @name) @item)))
(union_variant
name: (upper_case_identifier) @name) @item
(value_declaration
functionDeclarationLeft:
(function_declaration_left(lower_case_identifier) @name)) @item

View file

@ -16,7 +16,6 @@ mod c;
mod css;
mod deno;
mod elixir;
mod elm;
mod go;
mod json;
mod lua;
@ -59,7 +58,6 @@ pub fn init(
("cpp", tree_sitter_cpp::language()),
("css", tree_sitter_css::language()),
("elixir", tree_sitter_elixir::language()),
("elm", tree_sitter_elm::language()),
(
"embedded_template",
tree_sitter_embedded_template::language(),
@ -288,10 +286,6 @@ pub fn init(
"yaml",
vec![Arc::new(yaml::YamlLspAdapter::new(node_runtime.clone()))]
);
language!(
"elm",
vec![Arc::new(elm::ElmLspAdapter::new(node_runtime.clone()))]
);
language!("glsl");
language!("nix");
language!("nu", vec![Arc::new(nu::NuLanguageServer {})]);