Pony
Pony language support with syntax highlighting and LSP integration
How to install
With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.
You can also open the Extensions panel in the app and search for Pony. The extension's id is pony.
Don't have Forge Super yet? Download it here.
README
From the extension's repository, written by its authors and not by Mentenaz. See the source.
Pony Zed Extension
Pony language support for the Zed editor.
About Pony
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
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.
Installation
Prerequisites
To enable LSP features, install pony-lsp. On macOS and Linux one option is via Homebrew:
brew install ponyc
Alternitively, use ponyup, or build from source via the ponyc Git repository.
From Zed Extensions
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
Development Installation
To test this extension during development:
- Open Zed
- Navigate to the Extensions panel
- Click "Install Dev Extension"
- Select this repository directory
Configuration
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.
Configuring the LSP Server
- 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-lspis already on your PATH, you can omit theexecutablesetting.
Usage
Corral Tasks
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
Development
Prerequisites
- Zed editor
- Rust (required for building the extension)
- pony-lsp (optional, enables LSP features)
Building
The extension includes Rust code for LSP integration and must be compiled:
cargo build --release
The tree-sitter-pony grammar is automatically fetched and compiled by Zed when you install the extension.
Project Structure
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
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Troubleshooting
"pony-lsp not found on PATH"
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"
LSP compilation errors or "go to definition" not working
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
LSP server not starting
- 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
Extension not loading
- Check that Rust code compiles:
cargo build --release - Reload extensions in Zed:
cmd-shift-P→ "zed: reload extensions" - Check Zed log for extension errors
Resources
License
This project is licensed under the 2-Clause BSD License. See the LICENSE file for details.