Zyn0.1.0

Editors and tools

Zyn comes with a language server, zyn lsp, which gives editors what they need: errors as you type, the type of anything under the mouse, go to definition, completion and an outline of the file. The same type checker that runs your programs drives it, so the editor sees exactly the errors zyn run would.

#VS Code

The extension is in editors/vscode in the repository. It adds syntax highlighting and starts zyn lsp. To install it from the repository:

cd editors/vscode
npx @vscode/vsce package
code --install-extension zyn-*.vsix

The extension starts the zyn it finds on your PATH; the zyn.path setting can point it elsewhere. See editors/vscode/README.md.

#IntelliJ IDEA

The plugin in editors/intellij/plugin uses IntelliJ's built-in LSP support (IntelliJ IDEA Ultimate and other paid IDEs, 2025.2 or newer) and adds highlighting of its own. Build it and install it from disk:

cd editors/intellij/plugin
./gradlew buildPlugin

Then Settings → Plugins → ⚙ → Install Plugin from Disk… and pick the zip in build/distributions. For IntelliJ Community, editors/intellij/lsp4ij-template sets Zyn up with the free LSP4IJ plugin. See editors/intellij/README.md.

#Other editors

Any editor with LSP support can use Zyn: start zyn lsp for .zyn files. It talks JSON-RPC over stdin and stdout.

FeatureWhat you get
DiagnosticsErrors and warnings while typing, also from files the open one imports
HoverTypes of variables and expressions, signatures of functions
Go to definitionAlso into other files
CompletionMembers after ., and names in scope
Document symbolsAn outline of the file's functions, types and members

#Projects

In a project, the language server uses the project's libraries, so classes from Maven dependencies type-check and complete as you type. It checks build.zyn too, with completion for what each block can have. When build.zyn is saved, the project is read again; new libraries download in the background, and then open files are checked again.

#Warnings

Besides errors, the checker warns about things that are probably mistakes. Warnings don't stop a program:

fn total(prices: List<Int>): Int {
    var sum = 0
    let unused = "never read"
    for p in prices { sum += p }
    return sum
}

println(total([1, 2, 3]))
Warning and output
Warning: 'unused' is never used
  --> main.zyn:3:5
  |
3 |     let unused = "never read"
  |     ^

6

Unused variables, vars that never change (use let), and unused loop variables and pattern names (use _) are reported. Names starting with _ are never warned about.