Files
PgTidy/editors/datagrip
warkanum e88d32f281
CI / Test (push) Failing after 47s
CI / Build snapshot (push) Has been skipped
feat: add LSP server, VSCode + DataGrip extensions, release infra, autofix
- pkg/lsp: JSON-RPC 2.0 LSP server (formatting, diagnostics, codeAction quick-fixes)
- cmd/pgtidy: lsp and config subcommands
- pkg/diagnostics: TextFix struct for byte-range autofixes
- pkg/lint: MIG001/MIG003 autofixes, ApplyFixes helper, --fix flag on lint command
- editors/vscode: TypeScript extension with LanguageClient, showVersion/showConfig/formatDocument commands, logo
- editors/datagrip: Gradle JetBrains plugin via LSP4IJ, pluginIcon
- .goreleaser.yaml, .github/workflows: CI + release pipeline
- Makefile: snapshot, release, vscode-compile, vscode-package targets
- go.mod + all imports: module path updated to git.warky.dev/wdevs/pgtidy
- assets: logo files (256px, 128px, 1024px, ico)
2026-06-28 12:48: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.