Alpha. Vary is under active development and not ready for production use. Syntax, APIs, performance, and behaviour may change between releases.

VS Code

Vary has a VS Code extension with syntax highlighting, a language server (hover, go-to-definition, completions, formatting, rename, semantic tokens), and format-on-save.

Note: The Vary extension is not yet published to the VS Code marketplace. Install it from the .vsix file bundled with every toolchain.

Install the extension

The .vsix file is included in every Vary toolchain under vscode-vary/. If you installed Vary with varyup, use it to install the extension:

varyup vscode install

This finds the .vsix in the active toolchain and runs code --install-extension automatically. If code is not on your PATH, it prints the .vsix path so you can install manually.

To get the .vsix path for scripting:

varyup which vsix

Manual install

If you are not using varyup, install the extension directly:

# Linux
code --install-extension /path/to/vary/vscode-vary/varylang-*.vsix --force

# Windows
code --install-extension "$HOME\path\to\vary\vscode-vary\varylang-*.vsix" --force

After installing or updating the extension, reload VS Code (Ctrl+Shift+P > "Developer: Reload Window").

Make sure vary is on your PATH. The extension starts the language server automatically when you open a .vary file.

Dev Containers

Dev Containers run the compiler, language server, and extension inside a Docker container. This works on Windows, macOS, and Linux without installing Vary locally.

Prerequisites: Docker Desktop (Windows/macOS) or Docker Engine (Linux), and the Dev Containers extension.

StepAction
1Open a Vary project that has a .devcontainer/devcontainer.json (create one with vary new my-app --devcontainer)
2Press Ctrl+Shift+P and select Dev Containers: Reopen in Container
3The container has the Vary CLI, the LSP server, and the extension already configured

No manual extension installation or PATH setup is needed inside the container.

What you get

FeatureHow
Syntax highlightingTextMate grammar, works out of the box
Hover informationLSP: type info, documentation, and check rule explanations
Go to definitionLSP: F12 or Ctrl+Click
CompletionsLSP: variables, functions, modules
Format on saveLSP: set vary.format.onSave to true
Rename symbolLSP: F2
Semantic tokensLSP: type-aware highlighting
DiagnosticsLSP: errors, warnings, and check findings with guidance text
Code actionsLSP: quick-fixes for check rule violations

Configuration

SettingDefaultDescription
vary.lsp.path"vary"Path to the Vary CLI binary
vary.lsp.args["lsp"]Arguments to start the language server
vary.lsp.trace.server"off"Trace level for LSP communication (off, messages, verbose)
vary.format.onSavefalseAutomatically format .vary files on save

VS Code Tasks

Projects created with vary new include .vscode/tasks.json with these tasks:

vary check src/           # Vary: Check
vary test test/            # Vary: Test
vary fmt src/              # Vary: Format
vary mutate src/ --tests test/  # Vary: Mutate

Run them from Terminal > Run Task or Ctrl+Shift+P > Tasks: Run Task.