[PR #1283] [MERGED] Fix formatting of argument lists #1000

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

📋 Pull Request Information

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

Base: mainHead: fix-line-comment-formatting


📝 Commits (2)

  • 73a4371 Fix formatting of argument lists
  • da04db0 Revert getBaseSeparator logic

📊 Changes

6 files changed (+82 additions, -33 deletions)

View changed files

📝 pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt (+21 -20)
📝 pkl-formatter/src/test/files/FormatterSnippetTests/input/method-call-trailing-lambdas.pkl (+24 -0)
📝 pkl-formatter/src/test/files/FormatterSnippetTests/output/line-breaks.pkl (+4 -3)
📝 pkl-formatter/src/test/files/FormatterSnippetTests/output/method-call-trailing-lambdas.pkl (+29 -0)
📝 pkl-parser/src/main/java/org/pkl/parser/GenericParser.java (+3 -3)
📝 pkl-parser/src/main/java/org/pkl/parser/syntax/generic/FullSpan.java (+1 -7)

📄 Description

This fixes two issues:

  1. Leading/trailing line comments surrounding a lambda should make that lambda not "trailing", because the formatting otherwise looks bad and also isn't stable
  2. Fix incorrect algorithm for detecting trailing lambda (currently, any number of lambdas makes the alg return true)

🔄 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/1283 **Author:** [@bioball](https://github.com/bioball) **Created:** 11/3/2025 **Status:** ✅ Merged **Merged:** 11/3/2025 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `fix-line-comment-formatting` --- ### 📝 Commits (2) - [`73a4371`](https://github.com/apple/pkl/commit/73a437162a0d9b8288a98025bac48318a4594f08) Fix formatting of argument lists - [`da04db0`](https://github.com/apple/pkl/commit/da04db0297188c652c1a345e3b52e43c57be3ffb) Revert getBaseSeparator logic ### 📊 Changes **6 files changed** (+82 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt` (+21 -20) 📝 `pkl-formatter/src/test/files/FormatterSnippetTests/input/method-call-trailing-lambdas.pkl` (+24 -0) 📝 `pkl-formatter/src/test/files/FormatterSnippetTests/output/line-breaks.pkl` (+4 -3) 📝 `pkl-formatter/src/test/files/FormatterSnippetTests/output/method-call-trailing-lambdas.pkl` (+29 -0) 📝 `pkl-parser/src/main/java/org/pkl/parser/GenericParser.java` (+3 -3) 📝 `pkl-parser/src/main/java/org/pkl/parser/syntax/generic/FullSpan.java` (+1 -7) </details> ### 📄 Description This fixes two issues: 1. Leading/trailing line comments surrounding a lambda should make that lambda not "trailing", because the formatting otherwise looks bad and also isn't stable 2. Fix incorrect algorithm for detecting trailing lambda (currently, any number of lambdas makes the alg return `true`) --- <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:12 +01:00
adam closed this issue 2025-12-30 01:28:12 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#1000