Extract Elixir extension (#10948)
This PR extracts Elixir support into an extension and removes the built-in Elixir support from Zed. As part of this, [Lexical](https://github.com/lexical-lsp/lexical) has been added as an available language server for Elixir. Since the Elixir extension provides three different language servers, you'll need to use the `language_servers` setting to select the one you want to use: #### Elixir LS ```json { "languages": { "Elixir": { "language_servers": [ "elixir-ls", "!next-ls", "!lexical", "..."] } } } ``` #### Next LS ```json { "languages": { "Elixir": { "language_servers": [ "next-ls", "!elixir-ls", "!lexical", "..."] } } } ``` #### Lexical ```json { "languages": { "Elixir": { "language_servers": [ "lexical", "!elixir-ls", "!next-ls", "..."] } } } ``` These can either go in your user settings or your project settings. Release Notes: - Removed built-in support for Elixir, in favor of making it available as an extension.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
("(" @open ")" @close)
|
||||
("[" @open "]" @close)
|
||||
("{" @open "}" @close)
|
||||
("\"" @open "\"" @close)
|
||||
("do" @open "end" @close)
|
||||
@@ -0,0 +1,18 @@
|
||||
name = "Elixir"
|
||||
grammar = "elixir"
|
||||
path_suffixes = ["ex", "exs"]
|
||||
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", "comment"] },
|
||||
{ start = "'", end = "'", close = true, newline = false, not_in = ["string", "comment"] },
|
||||
]
|
||||
tab_size = 2
|
||||
scope_opt_in_language_servers = ["tailwindcss-language-server"]
|
||||
|
||||
[overrides.string]
|
||||
word_characters = ["-"]
|
||||
opt_into_language_servers = ["tailwindcss-language-server"]
|
||||
@@ -0,0 +1,27 @@
|
||||
(
|
||||
(unary_operator
|
||||
operator: "@"
|
||||
operand: (call
|
||||
target: (identifier) @unary
|
||||
(#match? @unary "^(doc)$"))
|
||||
) @context
|
||||
.
|
||||
(call
|
||||
target: (identifier) @name
|
||||
(arguments
|
||||
[
|
||||
(identifier) @name
|
||||
(call
|
||||
target: (identifier) @name)
|
||||
(binary_operator
|
||||
left: (call
|
||||
target: (identifier) @name)
|
||||
operator: "when")
|
||||
])
|
||||
(#match? @name "^(def|defp|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp)$")) @item
|
||||
)
|
||||
|
||||
(call
|
||||
target: (identifier) @name
|
||||
(arguments (alias) @name)
|
||||
(#match? @name "^(defmodule|defprotocol)$")) @item
|
||||
@@ -0,0 +1,153 @@
|
||||
["when" "and" "or" "not" "in" "not in" "fn" "do" "end" "catch" "rescue" "after" "else"] @keyword
|
||||
|
||||
(unary_operator
|
||||
operator: "&"
|
||||
operand: (integer) @operator)
|
||||
|
||||
(operator_identifier) @operator
|
||||
|
||||
(unary_operator
|
||||
operator: _ @operator)
|
||||
|
||||
(binary_operator
|
||||
operator: _ @operator)
|
||||
|
||||
(dot
|
||||
operator: _ @operator)
|
||||
|
||||
(stab_clause
|
||||
operator: _ @operator)
|
||||
|
||||
[
|
||||
(boolean)
|
||||
(nil)
|
||||
] @constant
|
||||
|
||||
[
|
||||
(integer)
|
||||
(float)
|
||||
] @number
|
||||
|
||||
(alias) @type
|
||||
|
||||
(call
|
||||
target: (dot
|
||||
left: (atom) @type))
|
||||
|
||||
(char) @constant
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
[
|
||||
(atom)
|
||||
(quoted_atom)
|
||||
(keyword)
|
||||
(quoted_keyword)
|
||||
] @string.special.symbol
|
||||
|
||||
[
|
||||
(string)
|
||||
(charlist)
|
||||
] @string
|
||||
|
||||
(sigil
|
||||
(sigil_name) @__name__
|
||||
quoted_start: _ @string
|
||||
quoted_end: _ @string
|
||||
(#match? @__name__ "^[sS]$")) @string
|
||||
|
||||
(sigil
|
||||
(sigil_name) @__name__
|
||||
quoted_start: _ @string.regex
|
||||
quoted_end: _ @string.regex
|
||||
(#match? @__name__ "^[rR]$")) @string.regex
|
||||
|
||||
(sigil
|
||||
(sigil_name) @__name__
|
||||
quoted_start: _ @string.special
|
||||
quoted_end: _ @string.special) @string.special
|
||||
|
||||
(
|
||||
(identifier) @comment.unused
|
||||
(#match? @comment.unused "^_")
|
||||
)
|
||||
|
||||
(call
|
||||
target: [
|
||||
(identifier) @function
|
||||
(dot
|
||||
right: (identifier) @function)
|
||||
])
|
||||
|
||||
(call
|
||||
target: (identifier) @keyword
|
||||
(arguments
|
||||
[
|
||||
(identifier) @function
|
||||
(binary_operator
|
||||
left: (identifier) @function
|
||||
operator: "when")
|
||||
(binary_operator
|
||||
operator: "|>"
|
||||
right: (identifier))
|
||||
])
|
||||
(#match? @keyword "^(def|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp|defp)$"))
|
||||
|
||||
(binary_operator
|
||||
operator: "|>"
|
||||
right: (identifier) @function)
|
||||
|
||||
(call
|
||||
target: (identifier) @keyword
|
||||
(#match? @keyword "^(def|defdelegate|defexception|defguard|defguardp|defimpl|defmacro|defmacrop|defmodule|defn|defnp|defoverridable|defp|defprotocol|defstruct)$"))
|
||||
|
||||
(call
|
||||
target: (identifier) @keyword
|
||||
(#match? @keyword "^(alias|case|cond|else|for|if|import|quote|raise|receive|require|reraise|super|throw|try|unless|unquote|unquote_splicing|use|with)$"))
|
||||
|
||||
(
|
||||
(identifier) @constant.builtin
|
||||
(#match? @constant.builtin "^(__MODULE__|__DIR__|__ENV__|__CALLER__|__STACKTRACE__)$")
|
||||
)
|
||||
|
||||
(unary_operator
|
||||
operator: "@" @comment.doc
|
||||
operand: (call
|
||||
target: (identifier) @__attribute__ @comment.doc
|
||||
(arguments
|
||||
[
|
||||
(string)
|
||||
(charlist)
|
||||
(sigil)
|
||||
(boolean)
|
||||
] @comment.doc))
|
||||
(#match? @__attribute__ "^(moduledoc|typedoc|doc)$"))
|
||||
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
"%"
|
||||
] @punctuation
|
||||
|
||||
[
|
||||
","
|
||||
";"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
"<<"
|
||||
">>"
|
||||
] @punctuation.bracket
|
||||
|
||||
(interpolation "#{" @punctuation.special "}" @punctuation.special) @embedded
|
||||
|
||||
((sigil
|
||||
(sigil_name) @_sigil_name
|
||||
(quoted_content) @embedded)
|
||||
(#eq? @_sigil_name "H"))
|
||||
@@ -0,0 +1,6 @@
|
||||
(call) @indent
|
||||
|
||||
(_ "[" "]" @end) @indent
|
||||
(_ "{" "}" @end) @indent
|
||||
(_ "(" ")" @end) @indent
|
||||
(_ "do" "end" @end) @indent
|
||||
@@ -0,0 +1,7 @@
|
||||
; Phoenix HTML template
|
||||
|
||||
((sigil
|
||||
(sigil_name) @_sigil_name
|
||||
(quoted_content) @content)
|
||||
(#eq? @_sigil_name "H")
|
||||
(#set! language "heex"))
|
||||
@@ -0,0 +1,46 @@
|
||||
(call
|
||||
target: (identifier) @context
|
||||
(arguments (alias) @name)
|
||||
(#match? @context "^(defmodule|defprotocol)$")) @item
|
||||
|
||||
(unary_operator
|
||||
operator: "@" @name
|
||||
operand: (call
|
||||
target: (identifier) @context
|
||||
(arguments
|
||||
[
|
||||
(binary_operator
|
||||
left: (identifier) @name)
|
||||
(binary_operator
|
||||
left: (call
|
||||
target: (identifier) @name
|
||||
(arguments
|
||||
"(" @context.extra
|
||||
_* @context.extra
|
||||
")" @context.extra)))
|
||||
]
|
||||
)
|
||||
)
|
||||
(#match? @context "^(callback|type|typep)$")) @item
|
||||
|
||||
(call
|
||||
target: (identifier) @context
|
||||
(arguments
|
||||
[
|
||||
(identifier) @name
|
||||
(call
|
||||
target: (identifier) @name
|
||||
(arguments
|
||||
"(" @context.extra
|
||||
_* @context.extra
|
||||
")" @context.extra))
|
||||
(binary_operator
|
||||
left: (call
|
||||
target: (identifier) @name
|
||||
(arguments
|
||||
"(" @context.extra
|
||||
_* @context.extra
|
||||
")" @context.extra))
|
||||
operator: "when")
|
||||
])
|
||||
(#match? @context "^(def|defp|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp)$")) @item
|
||||
@@ -0,0 +1,2 @@
|
||||
(comment) @comment
|
||||
[(string) (charlist)] @string
|
||||
@@ -0,0 +1,28 @@
|
||||
// Taken from https://gist.github.com/josevalim/2e4f60a14ccd52728e3256571259d493#gistcomment-4995881
|
||||
[
|
||||
{
|
||||
"label": "mix test",
|
||||
"command": "mix",
|
||||
"args": ["test"]
|
||||
},
|
||||
{
|
||||
"label": "mix test --failed",
|
||||
"command": "mix",
|
||||
"args": ["test", "--failed"]
|
||||
},
|
||||
{
|
||||
"label": "mix test $ZED_SYMBOL",
|
||||
"command": "mix",
|
||||
"args": ["test", "$ZED_SYMBOL"]
|
||||
},
|
||||
{
|
||||
"label": "mix test $ZED_FILE:$ZED_ROW",
|
||||
"command": "mix",
|
||||
"args": ["test", "$ZED_FILE:$ZED_ROW"]
|
||||
},
|
||||
{
|
||||
"label": "Elixir: break line",
|
||||
"command": "iex",
|
||||
"args": ["-S", "mix", "test", "-b", "$ZED_FILE:$ZED_ROW"]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user