[PR #1268] [MERGED] Respect line breaks in operator chains and argument lists #985

Closed
opened 2025-12-30 01:28:07 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/1268
Author: @bioball
Created: 10/29/2025
Status: Merged
Merged: 11/3/2025
Merged by: @bioball

Base: mainHead: respect-line-breaks


📝 Commits (1)

  • 298126e Respect line breaks in operator chains and argument lists

📊 Changes

6 files changed (+179 additions, -22 deletions)

View changed files

📝 docs/modules/release-notes/pages/0.30.adoc (+1 -1)
📝 pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt (+47 -21)
📝 pkl-formatter/src/test/files/FormatterSnippetTests/input/expr-chain-grouping.pkl (+3 -0)
pkl-formatter/src/test/files/FormatterSnippetTests/input/line-breaks3.pkl (+58 -0)
📝 pkl-formatter/src/test/files/FormatterSnippetTests/output/expr-chain-grouping.pkl (+5 -0)
pkl-formatter/src/test/files/FormatterSnippetTests/output/line-breaks3.pkl (+65 -0)

📄 Description

If an operator chain or method call is multiline, keep those newlines in the formatted output.

Help preserve code like:

foo
  |> (it) -> it + 2
  |> (it) -> it / 2

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/1268 **Author:** [@bioball](https://github.com/bioball) **Created:** 10/29/2025 **Status:** ✅ Merged **Merged:** 11/3/2025 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `respect-line-breaks` --- ### 📝 Commits (1) - [`298126e`](https://github.com/apple/pkl/commit/298126e3d5119411339eea5fd1d6371b7f088ec6) Respect line breaks in operator chains and argument lists ### 📊 Changes **6 files changed** (+179 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `docs/modules/release-notes/pages/0.30.adoc` (+1 -1) 📝 `pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt` (+47 -21) 📝 `pkl-formatter/src/test/files/FormatterSnippetTests/input/expr-chain-grouping.pkl` (+3 -0) ➕ `pkl-formatter/src/test/files/FormatterSnippetTests/input/line-breaks3.pkl` (+58 -0) 📝 `pkl-formatter/src/test/files/FormatterSnippetTests/output/expr-chain-grouping.pkl` (+5 -0) ➕ `pkl-formatter/src/test/files/FormatterSnippetTests/output/line-breaks3.pkl` (+65 -0) </details> ### 📄 Description If an operator chain or method call is multiline, keep those newlines in the formatted output. Help preserve code like: ```pkl foo |> (it) -> it + 2 |> (it) -> it / 2 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:28:07 +01:00
adam closed this issue 2025-12-30 01:28:07 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#985