VS Code / Cursor extension for the AT Proto Lexicon DSL (.lexd).
Provides:
- Syntax highlighting (TextMate grammar)
- Language configuration (
////* */comments, brackets) - Language server features via a bundled LSP: diagnostics, hover, completion, go-to-definition
- Bundled
@lexd/stdlib-atprotoand@lexd/stdlib-standardsources for import resolution offline
Prerequisites
From the monorepo root:
pnpm install
pnpm build
This builds @lexd/core, @lexd/language-server, and this extension.
Run / install locally
Option A — Launch from the repo (F5)
- Open this monorepo in VS Code or Cursor.
- Open the Run and Debug view and choose Lexd Extension.
- Press F5 (or start debugging). A new Extension Development Host window opens with
vscode-lexdloaded. - Open any
examples/*.lexdfile to try diagnostics, hover, completion (@), and go-to-definition.
In monorepo dev mode the extension loads the sibling @lexd/language-server build (not the bundled server). Stdlib is resolved from workspace packages/stdlib-* via the LSP workspace index.
Option B — Install a VSIX (self-contained)
# From the monorepo root
pnpm package:vsix
code --install-extension packages/vscode-lexd/vscode-lexd-0.1.0.vsix
# or: cursor --install-extension packages/vscode-lexd/vscode-lexd-0.1.0.vsix
pnpm package:vsix runs vscode:prepublish, which:
- Builds
@lexd/coreand@lexd/language-server - Bundles the language server + core into
dist/server.bundle.js(esbuild) - Bundles the extension host into
dist/extension.js - Copies stdlib
.lexdsources intostdlib/{atproto,standard}
The resulting VSIX has no runtime dependency on the monorepo or npm packages.
Option C — Symlink into extensions folder
pnpm --filter vscode-lexd build
ln -s "$(pwd)/packages/vscode-lexd" ~/.vscode/extensions/lexd.vscode-lexd-0.1.0
# Restart VS Code / Cursor
Verify
- Open
examples/feed-post.lexd. - Introduce a syntax error (e.g.
name stringwithout:) — a diagnostic should appear. - Type
@inside a type body — completions should include@maxGraphemes. - Place the cursor on
Replyinreply?: Replyand run Go to Definition — it should jump totype Reply.