Pony language support for the Zed editor.
Pony is an open-source, object-oriented, actor-model, capabilities-secure, high-performance programming language. It features:
- Memory safety without garbage collection using reference capabilities
- Data-race freedom guaranteed at compile time
- Actor-based concurrency for high performance
- Type safety with static typing
- Pattern matching and modern functional programming features
This extension provides Pony language support for Zed, including:
- Syntax highlighting - Full syntax highlighting for Pony language constructs
- Auto-indentation - Smart indentation based on code structure
- Code navigation - Outline panel and breadcrumbs for quick navigation
- Bracket matching - Syntax-aware bracket pairing and rainbow brackets
- Vim text objects - Text objects for functions, classes, and comments (vim mode)
- Corral tasks - Built-in tasks for fetching dependencies and building projects
- Language Server Protocol (LSP) integration - Basic LSP support
- Go to definition - Navigate to symbol definitions
Note: The Pony LSP server (v0.2.2) is still in early development. Additional features like hover documentation, code completion, find references, and rename are not yet implemented in the server itself.
Once published, you'll be able to install this extension directly from the Zed extensions panel:
- Open Zed
- Press
cmd-shift-x(macOS) orctrl-shift-x(Linux/Windows) - Search for "Pony"
- Click Install
To test this extension during development:
- Open Zed
- Navigate to the Extensions panel
- Click "Install Dev Extension"
- Select this repository directory
To enable LSP features, you must install pony-lsp:
# Clone and build pony-language-server
git clone https://github.com/ponylang/pony-language-server
cd pony-language-server
make language_server
# The binary will be at: build/release/pony-lsp
# Add it to your PATH, for example:
export PATH="$PATH:$(pwd)/build/release"Verify installation:
which pony-lspNote: The language server must be built from source as there are no prebuilt binaries available.
The extension needs to know where to find the Pony standard library packages. Add this to your Zed settings.json:
- Open Zed settings:
cmd-,(macOS) orctrl-,(Linux/Windows) - Add the following configuration:
{
"lsp": {
"pony-language-server": {
"settings": {
"pony_stdlib_path": "/opt/homebrew/Cellar/ponyc/0.60.4/packages"
}
}
}
}Finding your stdlib path:
On macOS/Linux, run this command to find the correct path:
readlink -f $(which ponyc) | sed 's|/bin/ponyc|/packages|'Or manually locate it based on your Pony installation:
- Homebrew (Apple Silicon):
/opt/homebrew/Cellar/ponyc/VERSION/packages - Homebrew (Intel Mac):
/usr/local/Cellar/ponyc/VERSION/packages - Linux:
/usr/lib/ponyor/usr/share/ponyc/packages
Replace VERSION with your installed Pony version (e.g., 0.60.4).
The extension provides built-in tasks for Corral (Pony's package manager):
- corral fetch - Download dependencies defined in
corral.json - corral run -- ponyc - Build your project using Corral's package paths
To run a task:
- Open the command palette:
cmd-shift-P(macOS) orctrl-shift-P(Linux/Windows) - Type "task" and select "task: spawn"
- Choose a corral task from the list
- Zed editor
- Rust (required for building the extension)
- Pony compiler (required for building pony-language-server)
- pony-language-server (optional, enables LSP features)
The extension includes Rust code for LSP integration and must be compiled:
cargo build --releaseThe tree-sitter-pony grammar is automatically fetched and compiled by Zed when you install the extension.
pony-zed-extension/
βββ Cargo.toml # Rust project manifest
βββ extension.toml # Extension metadata and LSP registration
βββ src/
β βββ pony.rs # LSP integration code
βββ languages/ # Language definitions
β βββ pony/
β βββ config.toml # Language configuration
β βββ highlights.scm # Syntax highlighting rules
β βββ indents.scm # Auto-indentation rules
β βββ outline.scm # Code navigation and outline
β βββ brackets.scm # Bracket matching rules
β βββ textobjects.scm # Vim text object definitions
β βββ tasks.json # Corral build tasks
βββ LICENSE
βββ README.md
Contributions are welcome! Please feel free to submit issues or pull requests.
If you see this error when opening a .pony file:
- Verify installation:
which pony-lsp - Ensure the binary is in your PATH
- Restart Zed after modifying PATH
- Check Zed log for details:
cmd-shift-Pβ "zed: open log"
If the LSP server is running but features don't work:
- Ensure you've configured
pony_stdlib_pathin your Zed settings (see Configuration section above) - Verify the stdlib path exists:
ls /path/to/your/stdlib/builtin - Check the LSP logs:
cmd-shift-Pβ "zed: open log" - Look for "initial PONYPATH:" in the logs - it should include both your project and stdlib paths
- Ensure your project has a
corral.jsonfile listing local packages
- Verify pony-lsp is installed and on PATH
- Check Zed log for pony-lsp errors
- Ensure you're using pony-language-server v0.2.2 or later
- Check that Rust code compiles:
cargo build --release - Reload extensions in Zed:
cmd-shift-Pβ "zed: reload extensions" - Check Zed log for extension errors
- Zed Extension Documentation
- Pony Language Server
- Pony Language Tutorial
- Pony Language Website
- Pony GitHub Repository
This project is licensed under the 3-Clause BSD License. See the LICENSE file for details.