Skip to content

Complex insert support#90

Merged
shssoichiro merged 5 commits intoshssoichiro:masterfrom
lu-zero:complex-insert-support
Aug 22, 2025
Merged

Complex insert support#90
shssoichiro merged 5 commits intoshssoichiro:masterfrom
lu-zero:complex-insert-support

Conversation

@lu-zero
Copy link
Copy Markdown
Contributor

@lu-zero lu-zero commented Aug 15, 2025

This adds support for more tokens and improves how vertical span mix with horizontal (hopefully)

@lu-zero lu-zero force-pushed the complex-insert-support branch 3 times, most recently from c7332f4 to 02e0af9 Compare August 18, 2025 08:00
@shssoichiro shssoichiro requested a review from Copilot August 20, 2025 18:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds complex insert support to the SQL formatter, particularly improving how vertical spans mix with horizontal spans. The changes enhance tokenization support for SQL constructs like WINDOW clauses, DISTINCT FROM operators, ON CONFLICT clauses, and SET statements in UPDATE queries.

Key Changes:

  • Adds new ReservedNewlineAfter token type for handling statements that need newlines after them
  • Expands tokenizer support for additional SQL keywords and constructs
  • Improves span tracking to better handle inline vs. multi-line formatting decisions

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/tokenizer.rs Adds ReservedNewlineAfter token type and support for WINDOW, ON CONFLICT, PARTITION BY, and DISTINCT FROM keywords
src/lib.rs Adds Debug trait to SpanInfo and includes comprehensive tests for new formatting features
src/indentation.rs Updates indentation tracking to store SpanInfo alongside top-level tokens
src/formatter.rs Implements formatting logic for ReservedNewlineAfter tokens and improves span-based formatting decisions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lu-zero lu-zero force-pushed the complex-insert-support branch from 02e0af9 to 2ab0257 Compare August 21, 2025 07:09
@shssoichiro shssoichiro merged commit f0f8ffe into shssoichiro:master Aug 22, 2025
5 checks passed
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.

3 participants