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 with the
pony-lsplanguage server
Note
The Pony language server is still in early development. Some features are not yet implemented in the server itself.
To enable LSP features, install pony-lsp. On macOS and Linux one option is via Homebrew:
brew install ponycAlternitively, use ponyup, or build from source via the ponyc Git repository.
Install the release 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
The extension exposes the following settings under lsp.pony-lsp.settings in your Zed settings.json:
defines(optional) - A list of compile-time definitions.executable(optional) - Path to thepony-lspbinary. If not set, Zed will search forpony-lspon your system PATH.ponypath(optional) - A list of additional directories to search for Pony packages.
- Open Zed settings:
cmd-,(macOS) orctrl-,(Linux/Windows) - Add the following configuration:
{
"lsp": {
"pony-lsp": {
"settings": {
"executable": "/path/to/pony-lsp",
"ponypath": [
"/path/to/project-a/packages",
"/path/to/project-b/packages"
],
"defines": [
"MY_DEFINE_ONE",
"MY_DEFINE_TWO"
]
}
}
}
}Note
All options are optional! For example, if pony-lsp is already on your PATH, you can omit the executable setting.
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-lsp (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:
- Check the LSP logs:
cmd-shift-Pβ "zed: open log" - 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-lsp v0.61.0 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
This project is licensed under the 2-Clause BSD License. See the LICENSE file for details.