Axon for VSCode
Language support for the Axon
programming language: deterministic diagnostics, hover, go-to-definition,
document symbols, context-aware completion, and an opt-in LLM advisor —
all powered by axon-lsp, the
language's official Language Server Protocol implementation.
What you get
- Diagnostics — lex, parse, and type errors surface as squiggles
with
axon-lex / axon-parse / axon-type source tags and precise
ranges (a whole identifier for type errors, a single character for
punctuation errors).
- Hover — built-in types (
String, Integer, Channel<T>,
Trusted<T>, …) and declaration keywords (type, flow,
persona, channel, …) surface rich Markdown documentation;
user-defined declarations show their kind and signature.
- Go-to-definition — jump from any reference to the matching
top-level declaration.
- Document symbols — outline tree with sensible LSP
SymbolKind per declaration kind.
- Completion — context-aware. Cursor inside a type annotation
surfaces only types; cursor at top level surfaces declaration
keyword snippets (
flow, type, persona, …); cursor in a
declaration's name slot stays out of your way.
- Optional LLM advisor — opt-in command (
Axon: Ask Advisor)
that consults an Anthropic-backed advisor grounded in the embedded
language documentation. Requires a build of axon-lsp with
--features llm and the appropriate environment variables; see
the configuration section below.
Prerequisites
This extension talks to the axon-lsp binary over stdio. You need to
have the binary on your machine before the extension can do anything.
Three options, checked in order:
axon-lsp.serverPath setting (workspace or user) — absolute
path to the binary. Wins if set.
AXON_LSP_PATH environment variable — same effect, slightly
less discoverable in the editor's settings panel.
axon-lsp on PATH — falls back to a bare command name and
relies on the OS to resolve. Works after cargo install or after
downloading a release binary into a PATH directory.
If none of the three resolve, the extension surfaces a clear error
message naming all options.
Configuration
{
// Absolute path to the axon-lsp binary. Leave empty to fall back
// to AXON_LSP_PATH or PATH.
"axon-lsp.serverPath": "",
// LSP traffic tracing. `verbose` runs the server with
// `AXON_LSP_LOG=debug`.
"axon-lsp.trace.server": "off" // off | messages | verbose
}
For the LLM advisor (optional), the binary itself must be built with
--features llm and the following env vars must be set when VSCode
spawns the server:
AXON_LSP_LLM_ENABLED=1 — runtime opt-in.
ANTHROPIC_API_KEY=... — backing API key.
AXON_LLM_MODEL=... — optional model override (default
claude-haiku-4-5-20251001).
Set these in your shell profile or .envrc so VSCode inherits them.
Without all three, Axon: Ask Advisor returns a structured
MethodNotFound whose message names the missing pieces.
Commands
- Axon: Ask Advisor (
axon-lsp.askAdvisor) — prompts for a
question, optionally attaches the editor's current selection as
code context, and shows the answer in the Axon Advisor output
channel. Requires the LLM advisor to be enabled (see above).
- Axon: Restart Language Server (
axon-lsp.restartServer) —
stops and restarts the LSP client. Useful after upgrading the
binary or changing environment variables.
Building locally
cd editors/vscode
npm install
npm run compile # → out/extension.js
To produce a .vsix package: npm install -g @vscode/vsce then
vsce package from this directory.
License
MIT — see the repository LICENSE.