1# Elixir
2
3- Tree Sitter: [tree-sitter-elixir](https://github.com/elixir-lang/tree-sitter-elixir)
4- Language Server: [elixir-ls](https://github.com/elixir-lsp/elixir-ls)
5
6### Setting up `elixir-ls`
7
81. Install `elixir`:
9
10```bash
11brew install elixir
12```
13
142. Install `elixir-ls`:
15
16```bash
17brew install elixir-ls
18```
19
203. Restart Zed
21
22{% hint style="warning" %}
23If `elixir-ls` is not running in an elixir project, check the error log via the command palette action `zed: open log`. If you find an error message mentioning: `invalid LSP message header "Shall I install Hex? (if running non-interactively, use \"mix local.hex --force\") [Yn]`, you might need to install [`Hex`](https://hex.pm). You run `elixir-ls` from the command line and accept the prompt to install `Hex`.
24{% endhint %}
25
26### Formatting with Mix
27
28If you prefer to format your code with [Mix](https://hexdocs.pm/mix/Mix.html), use the following snippet in your `settings.json` file to configure it as an external formatter. Formatting will occur on file save.
29
30```json
31{
32 "language_overrides": {
33 "Elixir": {
34 "format_on_save": {
35 "external": {
36 "command": "mix",
37 "arguments": ["format", "--stdin-filename", "{buffer_path}", "-"]
38 }
39 }
40 }
41 }
42}
43```