API Stability Notice
Macroforge is under active development. The API is not yet stable and may change between versions. Some documentation sections may be outdated.
vtsls-macroforge
A Zed extension that wraps VTSLS (VS Code's TypeScript language server) with the @macroforge/typescript-plugin pre-configured for compile-time macros.
Features
- Full TypeScript language features via VTSLS
- Macro expansion at edit time
- Accurate error positions in original source
- Completions for macro-generated methods
- Automatic download of
@vtsls/language-serverand@macroforge/typescript-plugin - Platform-aware native binary installation
How It Works
The extension:
- Downloads
@vtsls/language-serverand@macroforge/typescript-pluginfrom npm - Launches VTSLS as the language server
- Configures VTSLS with the macroforge plugin via
globalPlugins
Installation
1. Clone the Repository
git clone https://github.com/macroforge-ts/zed-extensions.git
cd macroforge-ts/crates/extensions/vtsls-macroforge2. Install as Dev Extension in Zed
In Zed, open the command palette and run zed: install dev extension, then select the vtsls-macroforge directory.
Alternatively, symlink to your Zed extensions directory:
# macOS
ln -s /path/to/macroforge-ts/crates/extensions/vtsls-macroforge ~/Library/Application\\ Support/Zed/extensions/installed/vtsls-macroforge
# Linux
ln -s /path/to/macroforge-ts/crates/extensions/vtsls-macroforge ~/.config/zed/extensions/installed/vtsls-macroforge3. Configure Zed Settings
Add this to your .zed/settings.json:
{
"languages": {
"TypeScript": {
"language_servers": ["macroforge-ts", "!vtsls", "!typescript-language-server"]
}
}
}Supported Languages
| Language | Supported |
|---|---|
| TypeScript | Yes |
| TSX | Yes |
| JavaScript | Yes |
Troubleshooting
Extension not loading
Make sure you've restarted Zed after installing the extension. Check the Zed logs for any error messages.
Macros not expanding
Ensure your project has the macroforge package installed. The extension handles the TypeScript plugin configuration automatically — you don't need to add it to your tsconfig.json when using this extension.