Skip to content

Zed extension

The Elide extension for Zed: elide lsp as a Java language server, an Elide debug adapter for JavaScript, TypeScript and Python, and debugging from Zed tasks.

On this page

The Elide extension for Zed adds elide lsp as a Java language server and an Elide debug adapter for JavaScript, TypeScript and Python. Any Zed task that runs elide run or elide test also shows up in the debugger’s Debug tab.

Requirements

RequirementWhy
Elide 1.6.0 or newer on PATHThe extension runs elide; set another path in settings.
Zed’s Java extensionIt defines the Java language.
The Pkl extensionHighlights elide.pkl. Optional.
elide setup pythonOnly to debug Python.

Install

Install it as a dev extension, which needs Rust through rustup:

git clone https://github.com/elide-dev/zed elide-zed

In Zed, open Extensions, choose Install Dev Extension and select the elide-zed directory.

Java language server

Name elide in the Java language_servers list of settings.json. To use it instead of jdtls:

{
  "languages": {
    "Java": { "language_servers": ["elide", "!jdtls", "..."] }
  }
}

["elide", "jdtls"] keeps both; ["!elide", "..."] turns Elide off. The server reads the workspace root Zed sends, and an elide.pkl there makes it an Elide project, so dependencies resolve. It provides diagnostics, completion, hover, navigation, rename, formatting, code actions, inlay hints and semantic tokens; see Other editors for the full list.

To run a specific binary or pass extra flags:

{
  "lsp": {
    "elide": {
      "binary": { "path": "/opt/elide/bin/elide", "arguments": ["lsp"] }
    }
  }
}

arguments replaces the default ["lsp"].

Debugging

Open the debugger with debugger: start (F4) and pick a scenario from .zed/debug.json, a task from the Debug tab, or Launch with the Elide adapter. launch starts elide run --debugger=dap (or elide test with "command": "test") and connects; attach connects to a program already listening:

[
  { "label": "Debug app.ts", "adapter": "Elide", "request": "launch", "program": "app.ts" },
  { "label": "Debug this file", "adapter": "Elide", "request": "launch", "program": "$ZED_FILE" },
  { "label": "Debug tests", "adapter": "Elide", "request": "launch", "command": "test", "args": ["app.test.ts"] },
  { "label": "Attach", "adapter": "Elide", "request": "attach", "tcp_connection": { "host": "127.0.0.1", "port": 4711 } }
]
Launch fieldMeaning
programFile to run, relative to cwd.
argsArguments after program.
cwdWorking directory; defaults to the worktree root.
envExtra environment variables.
commandrun (default) or test.
elideArgsElide flags before program, such as ["--max-mem=512m"].
host, portDAP listener; defaults to 127.0.0.1 and a free port (4711 to attach).

Program output appears in the debug console. To attach, start the program yourself:

elide run --debugger=dap app.py

To make Elide the default debugger for a language’s gutter and new-process modal:

{ "languages": { "TypeScript": { "debuggers": ["Elide"] } } }

Limits

  • Java and Kotlin debugging (JDWP) isn’t offered: Zed debugs Java only through the Java extension.

Was this page helpful?