Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Latest commit

 

History

History
43 lines (32 loc) · 1.23 KB

elixir.md

File metadata and controls

43 lines (32 loc) · 1.23 KB

Elixir

Setting up elixir-ls

  1. Install elixir:
brew install elixir
  1. Install elixir-ls:
brew install elixir-ls
  1. Restart Zed

{% hint style="warning" %} If 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. You run elixir-ls from the command line and accept the prompt to install Hex. {% endhint %}

Formatting with Mix

If you prefer to format your code with Mix, use the following snippet in your settings.json file to configure it as an external formatter. Formatting will occur on file save.

{
  "language_overrides": {
    "Elixir": {
      "format_on_save": {
        "external": {
          "command": "mix",
          "arguments": ["format", "--stdin-filename", "{buffer_path}", "-"]
        }
      }
    }
  }
}