Skip to content

Conversation

Copy link

Copilot AI commented Feb 6, 2026

The useNewLine() check compared raw content length against MaxLineLen, but didn't account for brackets, braces, separators, and property syntax that get added during output. This caused arrays and objects exceeding print width to remain on single lines.

// Before: stays on one line despite exceeding 80 chars
LET a = { a: "foo", b: { c: "Lorem ipsum dolor sit amet", d: "Lorem ipsum dolor sit amet" } }

// After: correctly wraps when exceeding print width
LET a = {
    a: "foo",
    b: { c: "Lorem ipsum dolor sit amet", d: "Lorem ipsum dolor sit amet" }
}

Changes

  • ArrayScope: Add Len() that includes [] brackets and , separators; override useNewLine() to use accurate length
  • ObjectScope: Add Len() that includes {} braces, internal { } spacing, and , separators; override useNewLine() to use accurate length
  • PropertyAssignmentScope: Enhance Len() to include : for non-shorthand properties
Original prompt

Implement FQL (Ferret Query Language) formatter.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…FQL formatter

Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com>
Copilot AI changed the title [WIP] Add FQL formatter implementation Fix line wrapping for arrays and objects in FQL formatter Feb 6, 2026
Copilot AI requested a review from ziflex February 6, 2026 21:26
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