From d20fb1f556721965b75af53aabd97c55e6204eb9 Mon Sep 17 00:00:00 2001 From: Waseem Al-Dmeiri Date: Tue, 28 Apr 2026 09:19:05 +0300 Subject: [PATCH] docs: add project setup instructions to README - Document required `postgres-language-server.jsonc` config file at project root, since the language server stays inactive without it - Provide a sample config covering schema reference, linter rules, and database connection fields - Note that Zed must be reloaded to pick up the new configuration - Link to upstream Postgres Language Server docs for the full configuration reference --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index 5f45d76..b5b25bc 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,38 @@ To install navigate to: **Zed** > **Extensions**. Or use the command palette ([macOS](https://github.com/zed-industries/zed/blob/main/assets/keymaps/default-macos.json#L581), [Linux](https://github.com/zed-industries/zed/blob/main/assets/keymaps/default-linux.json#L459)) to search `extensions`. This extension integrates the [Postgresql Language Server](https://github.com/supabase-community/postgres-language-server). + +## Project Setup + +The language server will not provide diagnostics, autocomplete, or hover until it finds a configuration file. **You must create a `postgres-language-server.jsonc` file at the root of your project** and fill in your database connection details. + +### 1. Create `postgres-language-server.jsonc` at the project root + +```jsonc +{ + "$schema": "https://pg-language-server.com/latest/schema.json", + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "db": { + "host": "127.0.0.1", + "port": 5432, + "username": "postgres", + "password": "postgres", + "database": "postgres", + "connTimeoutSecs": 10, + "allowStatementExecutionsAgainst": ["127.0.0.1/*", "localhost/*"] + } +} +``` + +Replace the values under `db` with your own connection details. Use the discrete fields shown above. + +### 2. Reload Zed + +Reopen the workspace (or restart Zed) so the language server picks up the new configuration. + +For the full configuration reference (linter rules, formatter, type checking, etc.) see the upstream [Postgres Language Server documentation](https://pg-language-server.com/latest/).