You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey — I put together an implementation of this and wanted to check if you'd be open to a PR before submitting.
What it does:
Registers a "Format SQL" action in the Monaco editor (Shift+Alt+F / Shift+Option+F)
Adds a toolbar button (WrapText icon) next to the Parameters button
Adds a right-click context menu entry
Supports formatting the full document or just the selection
Auto-detects dialect from the active connection via toFormatterLanguage()
How it works:
The sql-formatter package and formatSql() utility in src/utils/sqlFormat.ts already exist in the codebase — I just wired them into SqlEditorWrapper.tsx as a Monaco addAction (same pattern as the paste and run commands). The toolbar button in Editor.tsx triggers the same action.
Diff is small: 3 files, ~70 lines. Passes pnpm typecheck and pnpm lint cleanly; existing sqlFormat.test.ts tests still pass.
A few questions if you're interested:
Would you prefer this as a user-configurable setting (keyword case, indent width, etc.) or is the current default (keywordCase: 'upper', 2-space indent) fine for a first pass?
Any preference on the toolbar icon? I used WrapText from lucide-react but happy to change.
Should I add the i18n key to all locale files, or do you handle that on your end?
Happy to adjust the implementation to match your vision — just let me know.
Activity
aesslinger commentedon Jul 20, 2026
Hey — I put together an implementation of this and wanted to check if you'd be open to a PR before submitting.
What it does:
Shift+Alt+F/Shift+Option+F)toFormatterLanguage()How it works:
The
sql-formatterpackage andformatSql()utility insrc/utils/sqlFormat.tsalready exist in the codebase — I just wired them intoSqlEditorWrapper.tsxas a MonacoaddAction(same pattern as the paste and run commands). The toolbar button inEditor.tsxtriggers the same action.Diff is small: 3 files, ~70 lines. Passes
pnpm typecheckandpnpm lintcleanly; existingsqlFormat.test.tstests still pass.A few questions if you're interested:
keywordCase: 'upper', 2-space indent) fine for a first pass?WrapTextfrom lucide-react but happy to change.Happy to adjust the implementation to match your vision — just let me know.
debba commentedon Jul 20, 2026
Hi @aesslinger!
Looks interesting .
Can you open a PR if you already did it?
We can discuss inside the PR.