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.

Zed Extensions

Macroforge provides two extensions for the Zed editor: one for TypeScript via VTSLS, and one for Svelte.

Developer Installation Required
These extensions are not yet in the Zed extension registry. You'll need to install them as developer extensions.

Available Extensions

ExtensionDescriptionLocation
vtsls-macroforgeVTSLS with macroforge support for TypeScriptcrates/extensions/vtsls-macroforge
svelte-macroforgeSvelte language support with macroforgecrates/extensions/svelte-macroforge

Installation

1. Clone the Repository

Bash
git clone https://github.com/rymskip/macroforge-ts.git
cd macroforge-ts

2. Build the Extension

Build the extension you want to use:

Bash
# For VTSLS (TypeScript)
cd crates/extensions/vtsls-macroforge

# Or for Svelte
cd crates/extensions/svelte-macroforge

3. Install as Dev Extension in Zed

In Zed, open the command palette and run zed: install dev extension, then select the extension directory.

Alternatively, symlink the extension to your Zed extensions directory:

Bash
# 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-macroforge

vtsls-macroforge

This extension wraps VTSLS (a TypeScript language server) with macroforge integration. It provides:

  • Full TypeScript language features
  • Macro expansion at edit time
  • Accurate error positions in original source
  • Completions for macro-generated methods

svelte-macroforge

This extension provides Svelte support using the @macroforge/svelte-language-server. It includes:

  • Svelte component syntax support
  • HTML, CSS, and TypeScript features
  • Macroforge integration in script blocks

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 and a valid tsconfig.json with the TypeScript plugin configured.