Files
zed/docs/src/languages/elixir.md
T
morgankrey 9168df6260 docs: Apply documentation standards across all docs (#49177)
## Summary

Comprehensive remediation of 146 documentation files to align with Zed's
documentation conventions and brand voice guidelines.

## Changes

### YAML Frontmatter
- Added `title` and `description` frontmatter to all docs missing it

### Settings UI Pattern
- Updated 48+ files to show Settings Editor before JSON examples
- Pattern: `Configure X in Settings ({#kb zed::OpenSettings}), or add to
your settings file:`
- Added `([how to edit](./configuring-zed.md#settings-files))` links for
JSON-only settings

### Brand Voice Fixes
- Removed exclamation points (command-palette, key-bindings, repl,
privacy-and-security, etc.)
- Simplified em dash chains to parentheticals (environment,
troubleshooting, agent-panel, etc.)
- Fixed marketing language (yarn.md intro, development/linux.md)

### Terminology Alignment
- `settings UI` -> `Settings Editor`
- `sidebar` -> specific panel names (Project Panel, Collab Panel)
- `directory` -> `folder` in non-technical contexts
- `workspace` -> `project` in non-LSP contexts
- `Command Palette` -> `command palette` (lowercase)

### Callout Standardization
- Converted various callout formats to standard `> **Note:**` pattern

## Related

Depends on conventions established in #49176.

Release Notes:

- N/A
2026-02-17 20:58:17 -06:00

5.0 KiB

title, description
title description
Elixir Configure Elixir language support in Zed, including language servers, formatting, and debugging.

Elixir

Elixir support is available through the Elixir extension.

Choosing a language server

The Elixir extension offers language server support for expert, elixir-ls, next-ls, and lexical.

elixir-ls is enabled by default.

Expert

Configure language servers in Settings ({#kb zed::OpenSettings}) under Languages > Elixir, or add to your settings file:

  "languages": {
    "Elixir": {
      "language_servers": ["expert", "!elixir-ls", "!next-ls", "!lexical", "..."]
    },
    "HEEX": {
      "language_servers": ["expert", "!elixir-ls", "!next-ls", "!lexical", "..."]
    }
  }

Next LS

Configure language servers in Settings ({#kb zed::OpenSettings}) under Languages > Elixir, or add to your settings file:

  "languages": {
    "Elixir": {
      "language_servers": ["next-ls", "!expert", "!elixir-ls", "!lexical", "..."]
    },
    "HEEX": {
      "language_servers": ["next-ls", "!expert", "!elixir-ls", "!lexical", "..."]
    }
  }

Lexical

Configure language servers in Settings ({#kb zed::OpenSettings}) under Languages > Elixir, or add to your settings file:

  "languages": {
    "Elixir": {
      "language_servers": ["lexical", "!expert", "!elixir-ls", "!next-ls", "..."]
    },
    "HEEX": {
      "language_servers": ["lexical", "!expert", "!elixir-ls", "!next-ls", "..."]
    }
  }

Setting up elixir-ls

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

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.

Formatting with Mix

If you prefer to format your code with Mix, configure it as an external formatter. Formatting will occur on file save.

Configure formatting in Settings ({#kb zed::OpenSettings}) under Languages > Elixir, or add to your settings file:

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

Additional workspace configuration options

You can pass additional elixir-ls workspace configuration options via lsp settings in your settings file (how to edit).

The following example disables dialyzer:

  "lsp": {
    "elixir-ls": {
      "settings": {
        "dialyzerEnabled": false
      }
    }
  }

See ElixirLS configuration settings for more options.

HEEx

Zed also supports HEEx templates. HEEx is a mix of EEx (Embedded Elixir) and HTML, and is used in Phoenix LiveView applications.

Using the Tailwind CSS Language Server with HEEx

To get all features (autocomplete, linting, and hover docs) from the Tailwind CSS language server in HEEx files, add the following to your settings file (how to edit):

{
  "lsp": {
    "tailwindcss-language-server": {
      "settings": {
        "includeLanguages": {
          "phoenix-heex": "html"
        },
        "experimental": {
          "classRegex": ["class=\"([^\"]*)\"", "class='([^']*)'"]
        }
      }
    }
  }
}

With these settings, you will get completions for Tailwind CSS classes in HEEx template files. Examples:

<%!-- Standard class attribute --%>
<div class="flex items-center <completion here>">
  <p class="text-lg font-bold <completion here>">Hello World</p>
</div>

<%!-- With Elixir expression --%>
<div class={"flex #{@custom_class} <completion here>"}>
  Content
</div>

<%!-- With Phoenix function --%>
<div class={class_list(["flex", "items-center", "<completion here>"])}>
  Content
</div>