feat(format): Doc-IR core, line_width (120) and where_wrap when_long
This commit is contained in:
@@ -29,7 +29,8 @@ indent_join: false # Extra indentation for JOIN … ON lines
|
||||
join_indent_size: 1 # Number of extra indent levels for JOINs
|
||||
|
||||
# always | when_long | never
|
||||
where_wrap: always # Each AND/OR condition on its own line
|
||||
where_wrap: always # Each AND/OR condition on its own line (when_long: only if the clause exceeds line_width)
|
||||
line_width: 120 # Target width for when_long wrapping; 0 = unlimited
|
||||
|
||||
where_and_or_indent: true # AND/OR indented one level under WHERE
|
||||
|
||||
|
||||
+1
-1
@@ -167,7 +167,7 @@ Legend: ✅ done · 🚧 in progress · ⬜ not started
|
||||
function call at the token level — formatted without space (known limitation).
|
||||
- Note: SQL keywords inside PL/pgSQL function bodies remain lowercase (matching
|
||||
the corpus golden files); casing is applied only to top-level DML.
|
||||
- _Still TODO: Wadler Doc-IR printer for width-aware wrapping of long lines._
|
||||
- ✅ Doc-IR core (`pkg/format/doc.go`: Text/Line/SoftLine/Group/Indent/IfBreak + `Render`) and `line_width` (default 120, 0 = unlimited). First consumer: `where_wrap: when_long` (`dmlWhereWhenLong`). _Still TODO: move the remaining DML builders (select lists, CASE, joins, subqueries) from string assembly onto Doc._
|
||||
- _Still TODO: LSP range formatting._
|
||||
|
||||
## ✅ Config expansion — DataGrip settings parity
|
||||
|
||||
Reference in New Issue
Block a user