
VS Code support for Vercel Labs Zero (.0 files and zero.json manifests).
Features
- TextMate syntax highlighting for Zero declarations, control flow, literals, primitive types, borrows,
std.*modules, and diagnostics-style identifiers. - Snippets for
main, functions, shapes, choices, enums, matches, tests, loops,std.fs,std.mem, and package scaffolding. - Hover documentation for Zero keywords, primitive types,
World,Maybe, ownership and borrow forms, and documented standard library helpers. - IntelliSense for language keywords, primitive types, local symbols,
use std.*imports, and current standard library helper names. - Document symbols, workspace symbols, go-to definition, signature help, semantic tokens, and rename support.
- Diagnostics from
zero check --json, including stable diagnostic codes, expected/actual/help text, and related locations when emitted by the compiler. - Formatting via
zero fmtwhen the compiler is installed, with a conservative whitespace fallback. - Refactoring actions for import organization, extracting a selected block into a function skeleton, common quick fixes, and fix-plan inspection through
zero fix --plan --json. - Commands for checking, running, explaining diagnostics, showing graph JSON, organizing imports, creating a CLI package, and showing compiler repair plans.
- JSON schema validation for
zero.json.
Requirements
The extension works without the Zero compiler for local editor features. Install the compiler for diagnostics, formatting, graph data, run/check commands, and compiler-backed repair plans:
curl -fsSL https://zerolang.ai/install.sh | bash
export PATH="$HOME/.zero/bin:$PATH"
zero --version
Settings
zero.compilerPath: path to the Zero compiler executable. Defaults tozero.zero.checkOnSave: runzero check --jsonon save.zero.checkOnType: run debounced diagnostics while editing.zero.diagnosticsDelayMs: check-on-type debounce.zero.formatWithCompiler: usezero fmtfor formatting.zero.target: optional target, for examplelinux-musl-x64.zero.emitKind: optional emit kind,exeorobj.
Development
npm install
npm run compile
npm test
npm run package
Open this folder in VS Code and press F5 to launch an Extension Development Host.
Source Notes
This project models the current Zero language, CLI, diagnostics, package, and standard library contracts from: