Files
PgTidy/editors/datagrip
Hein 4fab2fe652
CI / Test (push) Successful in 29s
CI / Build (push) Successful in 25s
feat(ui): add version display action and status bar widget
* Implement PgTidyShowVersionAction to show pgtidy version
* Create PgTidyStatusBarWidget for real-time version display
* Update plugin.xml to register new action and widget
2026-07-02 12:58:28 +02:00
..

PgTidy — DataGrip / JetBrains Plugin

Formats and lints SQL files in DataGrip (and any JetBrains IDE) via the LSP4IJ plugin.

Requirements

  • pgtidy binary on PATH — download from releases or build with go install git.warky.dev/wdevs/pgtidy/cmd/pgtidy@latest
  • LSP4IJ plugin installed (free, by Red Hat)
  • DataGrip 2024.3+ (or any JetBrains IDE 2024.3+)

Install the plugin

Option A — Install from disk (.zip)

  1. Build: ./gradlew buildPlugin (output in build/distributions/)
  2. In DataGrip: Settings → Plugins → ⚙ → Install Plugin from Disk… → select the .zip
  3. Restart the IDE

Option B — Install LSP4IJ and configure manually (no plugin build needed)

  1. Install LSP4IJ from the marketplace (Settings → Plugins → Marketplace → search "LSP4IJ")
  2. Go to Settings → Language Servers → + (Add)
  3. Fill in:
    • Name: PgTidy
    • Command: pgtidy lsp
  4. Under Mappings, add file patterns: *.sql, *.pgsql
  5. Click OK and restart the IDE

Features

  • FormattingCode → Reformat Code (Ctrl+Alt+L) formats the current SQL file
  • Diagnostics — lint findings shown as inspections (MIG001MIG003, COR001003, NAM001003)
  • Quick fixes — intention actions for MIG001 (add CONCURRENTLY) and MIG003 (add NOT VALID)

Troubleshooting

Server not starting: Check View → Tool Windows → LSP4IJ Consoles for stderr output. Most common cause: pgtidy not found on PATH — update the command to the full path, e.g. /usr/local/bin/pgtidy lsp.