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

  1. Copy the extension folder to your VS Code extensions:

    # macOS/Linux
    cp -r .vscode/extensions/ailang ~/.vscode/extensions/

    # Windows (PowerShell)
    Copy-Item -Recurse .vscode\extensions\ailang $env:USERPROFILE\.vscode\extensions\
  2. Restart VS Code

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 extension is installed
ls ~/.vscode/extensions/ | grep ailang

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

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.