VS Code
Visual Studio Code is supported via the Sage extension.
Installation
- Open VS Code
- Press
Cmd+Shift+X(Mac) orCtrl+Shift+X(Windows/Linux) to open Extensions - Search for “Sage”
- Click Install
Features
The Sage extension for VS Code provides:
- TextMate Highlighting — Syntax highlighting for all Sage constructs
- LSP Diagnostics — Real-time error reporting from the Sage compiler
- File Icons — Custom icon for
.sgfiles
Requirements
The language server requires sage to be on your PATH. Install via:
# Homebrew (macOS)
brew install sagelang/sage/sage
# Cargo
cargo install sage-lang
# Quick install
curl -fsSL https://raw.githubusercontent.com/sagelang/sage/main/scripts/install.sh | bash
Configuration
The extension can be configured in VS Code settings:
{
"sage.path": "/usr/local/bin/sage"
}
| Setting | Description | Default |
|---|---|---|
sage.path | Path to the sage binary | Auto-detected from PATH |
Troubleshooting
No syntax highlighting
If syntax highlighting isn’t working:
- Ensure the file has a
.sgextension - Check that the Sage extension is installed
- Try reloading the window:
Cmd+Shift+P→ “Developer: Reload Window”
No diagnostics
If you’re not seeing error diagnostics:
- Verify
sageis on your PATH:which sage - Check the Output panel: View → Output → select “Sage Language Server”
- Look for connection or startup errors
Extension not activating
If the extension isn’t activating:
- Check the Extensions panel for errors
- Disable and re-enable the extension
- Check VS Code’s developer console for errors