Syntax highlighting and language support for the Vera programming language — a statically typed, purely functional language with algebraic effects, mandatory contracts, and typed slot references (@T.n), designed for LLM-generated code.
Syntax highlighting for the full Vera language, including constructs that have no equivalent in other languages:
- Slot references —
@Int.0,@Array<String>.1,@Nat.result, and bare@Typebindings in match arms are all highlighted distinctly, since they are the primary way Vera code refers to values. - Contract blocks —
requires,ensures,effects,decreases, andinvariantare scoped separately from control flow keywords, so colour themes can distinguish verification annotations from program logic. - Effects — built-in effects (
IO,State,Exn,Http,Async,Diverge) and qualified operation calls (IO.print,Exn.throw) are highlighted with their components broken out. - String interpolation —
\(...)expressions inside strings get full Vera highlighting. - Nestable block comments —
{- ... {- ... -} ... -}handled correctly.
Language configuration so VS Code understands Vera's structure:
- Toggle line comments with
Cmd+/(uses--) - Toggle block comments with
Shift+Alt+A(uses{- ... -}) - Bracket matching and auto-closing for
{},[],(),<>,"", and{- -} - Code folding on brace blocks
- Auto-indentation on
{/} - Word selection that understands slot references as single tokens
Fresh clone:
git clone https://github.com/aallan/vera.git
ln -s "$(pwd)/vera/editors/vscode" ~/.vscode/extensions/vera-languageExisting clone (run from the repo root):
ln -s "$(pwd)/editors/vscode" ~/.vscode/extensions/vera-languageThen reload VS Code. Any .vera file will be recognised automatically.
If a packaged .vsix is available:
code --install-extension vera-language-0.1.0.vsixNot yet published. This is planned once the language reaches a stable release.
The grammar uses standard TextMate scope conventions, so it works with any colour theme. Key assignments:
| Vera construct | Scope |
|---|---|
@Int.0, @Array<String>.result |
variable.other.slot.vera |
@Int (in match binding) |
variable.other.slot-binding.vera |
requires, ensures, effects |
keyword.contract.vera |
if, match, let, handle |
keyword.control.vera |
fn, data, effect, import |
keyword.declaration.vera |
public, private |
storage.modifier.vera |
IO, State, Exn |
entity.name.type.effect.vera |
IO.print, Exn.throw |
effect + entity.name.function.effect-op.vera |
Some, None, Ok, Err |
entity.name.tag.constructor.vera |
Int, Bool, String |
storage.type.primitive.vera |
Array, Option, Result |
storage.type.composite.vera |
true, false, pure |
constant.language.vera |
-> |
keyword.operator.arrow.vera |
| ` | >` |
- Vera language
- Vera on GitHub
- TextMate bundle (same grammar, TextMate 2 packaging)
MIT