Skip to main content

Zed Extension

The nudo Zed extension attaches Nudo's language server to JavaScript and TypeScript buffers as a secondary language server — alongside vtsls / typescript-language-server.

Prerequisites​

  • Zed's bundled Node runtime (used to launch the server)
  • @nudojs/lsp ≥ 0.5.0 — the extension installs it automatically via Zed's managed npm (no manual install)

0.5.0+ ships dist/server.js with a nudo-lsp shebang entry and defaults to stdio when no transport flag is passed.

Install​

The extension lives in a standalone repository: nudojs/nudo-zed.

From source (dev)​

git clone https://github.com/nudojs/nudo-zed

In Zed: Extensions → Install Dev Extension… → select the cloned nudo-zed directory.

Settings​

Copy-paste defaults for ~/.config/zed/settings.json (or project .zed/settings.json):

{
"languages": {
"JavaScript": {
"language_servers": ["vtsls", "nudo", "..."]
},
"TypeScript": {
"language_servers": ["vtsls", "nudo", "..."]
}
},
"code_lens": "on",
"inlay_hints": { "enabled": true },
"semantic_tokens": "combined"
}

"..." keeps the remaining registered language servers. semantic_tokens: "combined" layers the server's contract / generated / derived modifiers onto the syntax highlighting (type-aware highlighting).

Binary override​

Skip the managed install and point Zed at a specific server (same surface as other Zed LSP extensions):

{
"lsp": {
"nudo": {
"binary": {
"path": "node",
"arguments": ["/abs/path/node_modules/@nudojs/lsp/dist/server.js"]
}
}
}
}

Or, if nudo-lsp is on PATH:

{
"lsp": {
"nudo": {
"binary": { "path": "nudo-lsp", "arguments": [] }
}
}
}

LSP settings passthrough​

lsp.nudo.settings and lsp.nudo.initialization_options are forwarded to the language server (same idea as VS Code LSP settings). Project analysis config (analysis.mode / include / exclude) still lives in package.json#nudo or nudo.json.

How the server is resolved​

The extension installs @nudojs/lsp via Zed's managed npm (npm_install_package) and launches <node_binary_path>/node_modules/@nudojs/lsp/dist/server.js --stdio — the same pattern as other Zed language-server extensions. A user lsp.nudo.binary override, when set, is used instead.

Features in Zed​

CapabilityNotes
DiagnosticsAutomatic for analysis targets (.js/.mjs/.ts); see nudo.analysis.mode for directive-less files
Hover types
Go to Definition / References / RenameStandard LSP (sidecar binding names included)
Inlay hintsEnable inlay_hints.enabled; implicit exports mark derived. Parameter contract hints (where …) are off by default — enable via language-servers.nudo.initialization_options: { "inlayHints": { "parameters": true } } (or package.json#nudo.inlayHints.parameters). When enabled, hints show the constraint's declared form (sidecar template expression / directive name, e.g. where nullable(astNode)); the full predicate rides the hint tooltip
CodeLensEnable code_lens: "on" — observation selector: ●/○ contract / hw|gen|imp (default active) + persist/update + ⚡ draft contract; ●/○ case "…" options follow
Semantic tokensDefault off; set semantic_tokens: "combined" — includes contract/generated/derived modifiers
Code actions / Signature helpStandard LSP quickfix + signature help (real paramTypes / return). Includes action-map quickfixes ([fix] / [silence] / [review] / [adjust] / [scaffold])
Agent commands (nudo.check / nudo.contract.draft / …)Reachable via any LSP client or Zed agent tooling
JSX / TSX buffersAttached (JavaScript React / TypeScript React), same document face as VS Code

CodeLens ⚡ draft contract runs the same code-first draft path as CLI nudo contract --draft (writes *.nudo.draft.js only when the client requests write: true). Migration walkthrough: Migrating existing JS.

VS Code-only decorations for the active case are not available; use the CodeLens case picker instead.

Full client comparison and known gaps: LSP Client Matrix.

File detection​

Analysis targets are .js, .mjs, and .ts. Shipped default package.json#nudo.analysis.mode is "exports"; mode semantics and the conservative "directives" gate: Coexistence. CodeLens contract tier uses the broader target path.

Building the WASM extension​

Zed compiles the extension when you install a dev extension. Manual build:

rustup target add wasm32-wasip2
cd nudo-zed
cargo build --target wasm32-wasip2 --release

See also​