Skip to content

Cross-editor diagnostics: toac lsp Language Server (v0.6.0)#3

Merged
ZubeidHendricks merged 4 commits into
mainfrom
lsp-language-server
Jun 17, 2026
Merged

Cross-editor diagnostics: toac lsp Language Server (v0.6.0)#3
ZubeidHendricks merged 4 commits into
mainfrom
lsp-language-server

Conversation

@ZubeidHendricks

Copy link
Copy Markdown
Owner

What

Brings TOAD's compiler diagnostics to every editor, not just VS Code. The launch checklist flagged "in-editor diagnostics (`toac check` → LSP)" as the #1 most-asked roadmap item; this ships it.

How

  • `packages/compiler/src/editor.ts` — editor-agnostic hover/completion services + the `KEY_DOCS`/`TEMPLATE_DOCS` tables, exported from `toad-compiler` as the single source of truth (0-based LSP positions, no editor SDK types, browser-safe).
  • `packages/compiler/src/lsp.ts` — a dependency-free Language Server over stdio. Hand-rolled JSON-RPC `Content-Length` framing (UTF-8-byte-correct), reusing `analyze`/`compile`/`formatAgent`/`editor.ts`. `createServer()` is a pure synchronous message handler → the protocol is exhaustively testable without spawning a process; `runLanguageServer()` wires it to stdio.
  • `toac lsp` — new CLI subcommand, lazy-imported so it never enters the browser playground bundle.
  • VS Code extension refactored to consume the shared services — it can no longer drift from the LSP.

Capabilities

Diagnostics (live, full-sync), hover, completion (`{`, `.` triggers), document formatting.

Tests

`editor.test.ts` + `lsp.test.ts` (lifecycle, diagnostic mapping, hover/completion/formatting, frame round-trips incl. multi-byte UTF-8, and an end-to-end stream run). 177 compiler + 62 runtime tests pass; typecheck + prettier clean. Verified end-to-end by driving the built `toac lsp` binary over real stdio.

Docs

Per-editor setup (Neovim, Helix, Zed, Emacs, JetBrains) in `site/ecosystem.md`; CLI reference, README, CHANGELOG, blog release notes, and the launch-checklist item ticked.

Release

Second commit bumps `toad-compiler`/`toad-runtime` to 0.6.0 (constants + tests), the VS Code extension to 0.5.0, and adds the 0.6.0 blog entry. Per `RELEASING.md`, npm publish triggers on a `v0.6.0` tag from `main` after merge — not done here (left to you, since it's an irreversible outward publish).

🤖 Generated with Claude Code

ZubeidHendricks and others added 4 commits June 17, 2026 14:20
The diagnostics `toac check` produces now reach any LSP editor — Neovim,
Helix, Zed, Emacs, JetBrains — not just VS Code.

- editor.ts: editor-agnostic hover/completion services + the KEY_DOCS/
  TEMPLATE_DOCS tables, exported from toad-compiler as the single source of
  truth (0-based positions, browser-safe).
- lsp.ts: a dependency-free Language Server over stdio (hand-rolled JSON-RPC
  framing) reusing analyze/compile/formatAgent/editor.ts. createServer() is a
  pure synchronous message handler, so the protocol is fully testable without
  a process; runLanguageServer() wires it to stdio.
- toac lsp: new CLI subcommand (lazy-imported; never pulled into the browser
  bundle).
- VS Code extension now consumes the shared services, so it can no longer
  drift from the LSP.
- Tests for both modules (177 pass); docs for per-editor setup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bump toad-compiler and toad-runtime to 0.6.0 (the cross-editor LSP release):
version constants + tests, the VS Code extension to 0.5.0, the CHANGELOG
section, and a release-notes blog entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The blog skipped from 0.2.0 straight to 0.6.0; fill in the three intervening
releases (typed tools/fmt/diagnostics, cost measurement, ephemeral results +
field projection) so the release history reads continuously. Dates match the
release commits.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Spawn the built `toac lsp` over real stdio and assert it initializes
(serverInfo + capabilities) and publishes the expected TOA203 diagnostic for
an invalid agent. Catches packaging / bin / lazy-import regressions the
in-process protocol tests can't — the server is only reachable as a subprocess.

Runs as `pnpm smoke:lsp`, wired into CI right after `pnpm build` (it needs the
compiler dist). No deps, no API, 10s timeout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ZubeidHendricks ZubeidHendricks merged commit 84422f7 into main Jun 17, 2026
1 check passed
@ZubeidHendricks ZubeidHendricks deleted the lsp-language-server branch June 17, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant