Skip to content

Editor Zed

Oliver Atkinson edited this page May 31, 2026 · 1 revision

Zed

Zed is the most complete editor setup in this repository because Lexicon includes a dev extension under:

Editors/Zed/lexicon

The extension attaches lexicon-lsp to Lexicon, Rust, and Go buffers.

1. Build the Language Server

swift build -c release --product lexicon-lsp

Either put it on PATH:

cp .build/release/lexicon-lsp /usr/local/bin/lexicon-lsp

Or keep the absolute path for Zed settings:

/absolute/path/to/Lexicon/.build/release/lexicon-lsp

2. Configure the Binary

Open Zed settings and add:

{
  "lsp": {
    "lexicon-lsp": {
      "binary": {
        "path": "/absolute/path/to/Lexicon/.build/release/lexicon-lsp"
      }
    }
  }
}

If lexicon-lsp is already on PATH, this setting is optional.

3. Install the Dev Extension

In Zed:

  1. Open the command palette.
  2. Run zed: install dev extension.
  3. Select Editors/Zed/lexicon.

Zed's extension docs call this "Install Dev Extension". Rust must be installed through rustup for dev extensions that include Rust/Wasm code.

4. Add Project Configuration

At your workspace root, add:

{
  "lexicon": "commerce.lexicon"
}

The file can be named lexicon-lsp.json, .lexicon-lsp.json, lexicon.conf, or .lexicon.conf.

5. Try the Example Workspace

zed Examples/Zed

Open demo.lexicon, demo.rs, or demo.go.

Try completing after:

l!(test.type.even.

or:

l("test.type.even.

The LSP should offer valid path segments such as bad and no. The intentionally wrong bed examples should be diagnosed as unknown Lexicon paths.

What the Extension Registers

The extension manifest registers:

  • Lexicon files with the .lexicon suffix.
  • lexicon-lsp for Lexicon, Rust, and Go.
  • language IDs lexicon, rust, and go.

The Lexicon language config uses hard tabs and # line comments.

Troubleshooting

If nothing starts:

  • Run swift build -c release --product lexicon-lsp.
  • Confirm the configured path exists and is executable.
  • Open Zed logs with zed: open log.
  • Launch Zed from a terminal with zed --foreground for more extension output.
  • Confirm lexicon-lsp.json points to a lexicon path relative to the config file.

If .lexicon files show indentation diagnostics, convert leading spaces to tabs.

Clone this wiki locally