pgfmt
PostgreSQL SQL formatting and diagnostics via pgfmt-lsp
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 pgfmt. The extension's id is pgfmt-lsp.
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.
pgfmt for Zed
A Zed extension that provides PostgreSQL SQL formatting and diagnostics via pgfmt-lsp.
Features
- Formatting — format SQL files on demand or automatically on save
- Diagnostics — SQL parse errors shown inline as you type
Installation
Install the extension from the Zed extension registry:
- Open the command palette (
cmd+shift+p) - Run Extensions: Install Extension
- Search for pgfmt and install it
The pgfmt-lsp binary is downloaded automatically from GitHub Releases for your platform — no manual installation required.
Configuration
Format on save
Add this to your Zed settings (cmd+,) or your project's .zed/settings.json:
{
"languages": {
"SQL": {
"formatter": "language_server",
"format_on_save": "on"
}
}
}
Custom binary path
If you'd prefer to manage pgfmt-lsp yourself (e.g. via go install or a version manager like mise), you can point the extension at your own binary and bypass the auto-download entirely:
{
"lsp": {
"pgfmt-lsp": {
"binary": {
"path": "/Users/you/go/bin/pgfmt-lsp"
}
}
}
}
Install the binary manually with:
go install github.com/middle-management/pgfmt/cmd/pgfmt-lsp@latest
Note: Zed does not inherit your shell's
$PATH, so tools managed by mise, asdf, or similar may not be found automatically. Use an absolute path in thebinary.pathsetting if the LSP fails to start.
Binary resolution order
When no explicit binary.path is configured, the extension resolves the binary as follows:
pgfmt-lspon the systemPATH(useful during local development)- A previously-downloaded binary cached in the extension directory
- Downloaded from the latest GitHub Release for your platform
Supported platforms
| OS | Architecture |
|---|---|
| macOS | arm64 (Apple Silicon) |
| macOS | amd64 (Intel) |
| Linux | amd64 |
| Linux | arm64 |
Contributing
See the pgfmt repository for source code, issue tracking, and contribution guidelines.