This PR extracts Erlang support into an extension and removes the built-in Erlang support from Zed. Tested using a Nix shell: ``` nix-shell -p erlang-ls ``` Release Notes: - Removed built-in support for Erlang, in favor of making it available as an extension. The Erlang extension will be suggested for download when you open a `.erl` or `.hrl` file.
25 lines
1.3 KiB
TOML
25 lines
1.3 KiB
TOML
name = "Erlang"
|
|
grammar = "erlang"
|
|
# TODO: support parsing rebar.config files
|
|
# # https://github.com/WhatsApp/tree-sitter-erlang/issues/3
|
|
path_suffixes = ["erl", "hrl", "app.src", "escript", "xrl", "yrl", "Emakefile", "rebar.config"]
|
|
line_comments = ["% ", "%% ", "%%% "]
|
|
autoclose_before = ";:.,=}])>"
|
|
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"] },
|
|
{ start = "'", end = "'", close = true, newline = false, not_in = ["string", "comment"] },
|
|
]
|
|
# Indent if a line ends brackets, "->" or most keywords. Also if prefixed
|
|
# with "||". This should work with most formatting models.
|
|
# The ([^%]).* is to ensure this doesn't match inside comments.
|
|
increase_indent_pattern = "^([^%]).*([{(\\[]]|\\->|after|begin|case|catch|fun|if|of|try|when|maybe|else|(\\|\\|.*))\\s*$"
|
|
|
|
# Dedent after brackets, end or lone "->". The latter happens in a spec
|
|
# with indented types, typically after "when". Only do this if it's _only_
|
|
# preceded by whitespace.
|
|
decrease_indent_pattern = "^\\s*([)}\\]]|end|else|\\->\\s*$)"
|