Skip to main content

Editor Setup

Get syntax highlighting + language-server intelligence (diagnostics, hover types, go-to-definition, find-references, document outline) for AILANG in your favorite editor.

VS Code users: ailang editor install vscode now ships both syntax highlighting AND the AILANG Language Server in one command. See LSP guide for what the LSP gives you and how it works under the hood.

The easiest way to install editor support is via the AILANG CLI:

# Install for VS Code
ailang editor install vscode

# Install for Vim
ailang editor install vim

# Install for Neovim
ailang editor install neovim

# Check installation status
ailang editor status

The CLI embeds all editor files, so it works from anywhere after ailang is installed.

VS Code

The extension shipped via ailang editor install vscode provides:

CapabilityWhat you see
Syntax highlighting + bracket matchingColored keywords, types, strings, etc.
DiagnosticsRed squigglies on type errors after save (powered by ailang lsp)
Hover typesType signature popups for top-level identifiers
Go to definitionCmd+click on a function name jumps to its decl
Find referencesRight-click → "Find All References"
Document outlineFunctions + ADT constructors in the outline sidebar

CLI Install

ailang editor install vscode

Then restart VS Code or run Developer: Reload Window (Cmd+Shift+P on Mac, Ctrl+Shift+P on Windows/Linux).

Manual Install

Copying a folder into ~/.vscode/extensions/ does not install anything

Since VS Code 1.74, ~/.vscode/extensions/extensions.json is the registry of installed extensions, not a cache. A folder with no entry in it is never scanned, so the extension silently does not load. Let VS Code do the install.

Use VS Code's own installer:

# Command palette: "Extensions: Install from VSIX..." — or, on the CLI:
code --install-extension <path-to>.vsix --force

ailang editor install vscode does exactly this for you: it builds the VSIX from the binary's embedded assets and hands it to whichever editor CLI it finds (code, code-insiders, cursor, windsurf, codium). If none is on your PATH it falls back to installing the extension directory and registering it in extensions.json, which is the part a manual cp misses.

To put code on your PATH: Cmd+Shift+P → Shell Command: Install 'code' command in PATH.

Troubleshooting

Colors not showing?

  1. Check file has .ail extension
  2. Check bottom-right of VS Code shows "AILANG" as language
  3. Try "Developer: Reload Window" (Cmd+Shift+P)
  4. Check for conflicting extensions

Diagnostics / hover / go-to-def not working?

  1. Check which ailang works — the LSP needs the binary on PATH
  2. Open VS Code's Output panel: View → Output → pick "AILANG Language Server" from the dropdown — any LSP startup errors surface here
  3. Verify the LSP process is alive: ps aux | grep "ailang lsp" should show one process per open .ail workspace
  4. See the LSP guide for deeper troubleshooting (workspace-setup, the MOD010 relax behaviour, the token-cost rationale)

Extension not loading?

# Verify VS Code will actually load it — this checks the registry, not just
# whether a folder exists on disk.
ailang editor status

# Or ask VS Code directly:
code --list-extensions --show-versions | grep ailang

# Check VS Code output for errors
# View > Output > Extension Host

A folder at ~/.vscode/extensions/ailang with no matching extensions.json entry is the broken state — ailang editor status reports it as such, and ailang editor install vscode repairs it. Listing the directory is not a check: it shows folders VS Code has marked obsolete and skips.

Vim

CLI Install

ailang editor install vim

Manual Install

cp -r editors/vim/* ~/.vim/

Files with .ail extension will automatically use AILANG syntax highlighting.

Neovim

CLI Install

ailang editor install neovim

Manual Install

# macOS/Linux
cp -r editors/vim/* ~/.config/nvim/

# Windows
Copy-Item -Recurse editors\vim\* $env:LOCALAPPDATA\nvim\

Sublime Text

Copy syntaxes/ailang.tmLanguage.json to your packages directory:

PlatformPath
macOS~/Library/Application Support/Sublime Text/Packages/User/
Linux~/.config/sublime-text/Packages/User/
Windows%APPDATA%\Sublime Text\Packages\User\

TextMate

Double-click syntaxes/ailang.tmLanguage.json to install.

Other Editors

Most modern editors that support TextMate grammars can use the syntaxes/ailang.tmLanguage.json file. Consult your editor's documentation for adding custom language support.

Syntax Highlighting Features

The grammar supports all AILANG language features:

FeatureExample
Comments-- comment or // comment
Keywordslet, letrec, func, match, if, then, else, type
Booleanstrue, false
Primitive typesint, float, bool, string, char, unit
Effect typesIO, FS, Net, Clock, Env, Rand, Debug, AI
Standard typesOption, Result, List, Tuple, Array
Strings"hello", 'c'
Numbers42, 3.14, 0xFF
Lambdas\x. x + 1
Operators->, =>, ::, ++, !, |
ADTstype Option[a] = Some(a) | None
Modulesmodule examples/hello
Importsimport std/io (println)
Exportsexport func main()

Managing Installations

# Check what's installed
ailang editor status

# Uninstall from an editor
ailang editor uninstall vscode
ailang editor uninstall vim
ailang editor uninstall neovim

Updating

When you update AILANG, the embedded editor files are updated too. Simply re-run:

ailang editor install vscode

This will replace the old extension with the new version.

AILANG uses operators like =>, ->, ::, and \ (lambda). Programming fonts with ligatures render these as beautiful single glyphs:

CharactersLigatureAILANG Usage
=>Match arms
->Function types
::Cons, type annotations
++Append
\λLambda
!=Not equal
<= >=≤ ≥Comparisons
FontInstallNotes
Fira Codebrew install --cask font-fira-codeMost popular
JetBrains Monobrew install --cask font-jetbrains-monoExcellent readability
Cascadia Codebrew install --cask font-cascadia-codeMicrosoft's font

VS Code Settings

Add to your settings.json:

{
"editor.fontFamily": "Fira Code, Menlo, Monaco, monospace",
"editor.fontLigatures": true
}

Vim/Neovim

Set in your terminal emulator (iTerm2, Alacritty, etc.) - Vim uses the terminal's font.