Editor and language server
Yona ships a TextMate grammar and a language server named yls.
yls and the VS Code and Zed integrations do not currently expose
yonac --require-effect-free. Run that flag from the compiler CLI when you need
strict E0203 validation for effect freedom, finite-case coverage, and structural
size-change termination. Ordinary parse, type, refinement, and linearity
diagnostics remain shared between yonac and the language server.
Install the Yona extension from Zed’s Extensions panel, then install the
Yona toolchain so yls is on PATH. The extension starts yls --stdio and
uses the official Tree-sitter grammar. To select a particular server binary:
{ "lsp": { "yls": { "binary": { "path": "/absolute/path/to/yls" } } } }The marketplace submission is tracked at https://github.com/zed-industries/extensions/pull/7348 until Zed merges it.
VS Code / Cursor
Section titled “VS Code / Cursor”The extension lives in the compiler repository at editors/vscode.
- Install the Yona toolchain so
ylsandyonacare onPATH(or setYONA_HOME). - Open the
editors/vscodefolder in VS Code and runnpm installthennpm run compile, or install a packaged.vsixwhen one is published. - Open a
.yonaor.yonaifile.
The extension starts yls --stdio. If the server is missing, highlighting still
works and a warning is shown.
Settings
Section titled “Settings”| Setting | Meaning |
|---|---|
yona.languageServer.path |
Absolute path to yls. Empty: search PATH, then $YONA_HOME/bin/yls, then the directory that contains yonac. |
yona.trace.server |
off, messages, or verbose LSP tracing (vscode-languageclient). |
Do not hard-code Homebrew or /usr/local prefixes. Discovery uses the
environment and sibling binaries.
Features
Section titled “Features”- Syntax highlighting (shared grammar with the documentation site)
- Comments, brackets, and
end-aware indentation - Diagnostics from parse, type, refinement, and linearity checking
- Hover, go-to-definition, highlight, and completion still work on a prefix that
parsed when the buffer is incomplete (
let answer = 42 in, a trailing operator, unfinisheddo/if/case). The squiggle stays the original parse error; recovery does not replace it. - Hover types, go-to-definition (same file, imported names, and
Module.fncalls), find references, document highlight, rename (imported names are renamed only in the current file) - Modules that start with
#/##documentation are analyzed as modules (same rule asyonac) - Workspace folder roots are searched for modules; open buffers refresh when
watched
.yona/.yonaifiles change - Completion, document/workspace symbols, semantic tokens
- Signature help, inlay hints, call hierarchy, explain-error code actions
Other editors
Section titled “Other editors”Any LSP client can launch:
yls --stdioOptional -I path adds a module search directory, matching yonac -I.
A Yona-written transport slice, yls-yona, speaks Content-Length JSON-RPC
over stdio (initialize, didOpen, shutdown, exit) using
Std\Io.readExact / writeBytes, Std\Json, and Std\Utf16. Hover and
definition still need the C++ yls binary, which remains the editor default.
Build it with CMake target yls-yona; smoke:
python3 scripts/ci/smoke_yls_yona.py out/build/x64-debug-linux/yls-yona. On
Windows, readExact / writeBytes put CRT stdio in binary mode so
Content-Length \r\n framing stays byte-exact.
Grammar source of truth
Section titled “Grammar source of truth”Edit site/grammars/yona.tmLanguage.json, then:
./scripts/sync-yona-grammar.sh./scripts/check-yona-grammar.shPackaging and Marketplace
Section titled “Packaging and Marketplace”Build a VSIX locally (no publisher token required):
cd editors/vscodenpm cinpm testnpm run vsixThen Extensions: Install from VSIX… and choose yona-<version>.vsix. Pull
requests and pushes to master/main also build that artifact
(vscode-extension job in CMake Multi-Platform) and do not publish it.
Release CI publishes the same VSIX to the Visual Studio Marketplace when a v*
tag is pushed (Release workflow jobs vscode-vsix then publish-marketplace).
vsce publish --packagePath reads VSCE_PAT from the environment. Open VSX
(publish-openvsx) runs ovsx publish --packagePath for publisher yona-lang
with repository secret OVSX_PAT. The job is still skipped if that secret is
unset so the workflow stays green. The yona-lang namespace is claimed on
Open VSX. Tag version must match
editors/vscode/package.json.
Manual publish (tokens in the environment, never committed):
npx vsce publish --packagePath yona-<version>.vsixnpx ovsx publish --packagePath yona-<version>.vsixSee editors/vscode/README.md.