Skip to content

Conversation

@psteinroe
Copy link
Collaborator

@psteinroe psteinroe commented Oct 2, 2025

todos:

  • go though all snapshots for formatting issues
  • implement text edit in lsp and cli
  • integrate formatter into lsp as an action and cli
  • formatter itself should parse ast before and after and if it does not match, return an error

@psteinroe psteinroe force-pushed the feat/pretty-print-try-2 branch from 4c5072f to c7d27e6 Compare October 30, 2025 19:08
@psteinroe psteinroe mentioned this pull request Dec 9, 2025
psteinroe and others added 10 commits December 29, 2025 09:52
Key fixes in this session:
- CREATE TYPE ... AS RANGE: Added line breaking before parameters
- CREATE TABLE OF type: Handle column overrides with WITH OPTIONS syntax
- CREATE STATISTICS: Added SoftOrSpace before ON clause
- RangeVar alias: Changed to SoftOrSpace for line breaking
- JsonFuncExpr: Fixed enum values (1=EXISTS, 2=QUERY, 3=VALUE)
- JSON expressions: Added location normalization for JsonParseExpr, JsonFuncExpr, JsonScalarExpr, JsonSerializeExpr
- RangeFunction: Added coldeflist emission for record functions
- SYSTEM_USER and similar: Emit without parentheses and uppercase
- AIndirection normalization: Added for JoinExpr, AExpr, RangeSubselect
- FOREIGN KEY constraint: Added line breaking before column list
- JsonSerializeExpr: Fixed double RETURNING clause emission
- Line length check: Allow lines with unbreakable long identifiers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Fix GRANT statement line breaking
- Fix CLUSTER stmt USING line breaking
- Fix REFRESH MATERIALIZED VIEW line breaking
- Fix ParamRef overflow (render as u32)
- Fix ResTarget AS line breaking
- Fix function call soft line breaks after/before parens
- Fix CREATE SEQUENCE options line breaking
- Fix ALTER TABLE SET EXPRESSION line breaking
- Fix CREATE FUNCTION name line breaking
- Add INCLUDE clause emission for UNIQUE, PRIMARY KEY, EXCLUDE constraints
- Fix CREATE TRANSFORM line breaking
- Fix DROP SUBSCRIPTION CASCADE/RESTRICT values
- Add NullTest and BoolExpr precedence info for parentheses
- Add comparison operator non-associativity handling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Major fixes in this commit:
- Fix RangeFunction alias + coldeflist syntax (func(...) AS alias (cols))
- Fix CREATE ROLE and RoleSpec identifier quoting for special chars
- Fix ALTER GROUP ADD/DROP USER syntax (was emitting wrong keywords)
- Fix CREATE FUNCTION SET option double emission
- Fix ALTER TYPE ADD ATTRIBUTE syntax (was emitting ADD COLUMN)
- Fix GRANT IN SCHEMA missing space before schema name
- Fix NORMALIZE function handling:
  - Detect built-in vs user-defined based on second argument
  - Quote user-defined normalize() to avoid conflict with built-in
- Add function name case normalization in tests
- Add NORMALIZE second argument normalization (ColumnRef <-> AConst)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
…izations

- ALTER SUBSCRIPTION: fix SET vs WITH options, ENABLE/DISABLE detection
- Common table expressions: add line breaks for readability
- Drop statement: add soft line break before objects
- Set operations: fix parenthesization for ORDER BY/LIMIT/OFFSET/WITH
- Normalizations: add JoinExpr ON TRUE -> NULL, handle nested structures

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@psteinroe psteinroe changed the title chore: pretty-print poc attempt 2 chore: initial pretty printer Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants