[PR #1256] [MERGED] Adjust formatting of line comments in lets #973

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

📋 Pull Request Information

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

Base: mainHead: line-comment-in-lets


📝 Commits (2)

  • caabd7d Adjust formatting of line comments in lets
  • 8e8e8d8 Address PR comments

📊 Changes

3 files changed (+95 additions, -5 deletions)

View changed files

📝 pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt (+9 -5)
📝 pkl-formatter/src/test/files/FormatterSnippetTests/input/comment-interleaved.pkl (+43 -0)
📝 pkl-formatter/src/test/files/FormatterSnippetTests/output/comment-interleaved.pkl (+43 -0)

📄 Description

Fixes an issue where line comments preceding let bodies are not indented.

Turn this:

bar3 =
  let (bar = new Dynamic {})
  // some coment
    (bar) {
      qux = 4
    }

Into this:

bar3 =
  let (bar = new Dynamic {})
    // some coment
    (bar) {
      qux = 4
    }

🔄 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/1256 **Author:** [@bioball](https://github.com/bioball) **Created:** 10/27/2025 **Status:** ✅ Merged **Merged:** 10/29/2025 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `line-comment-in-lets` --- ### 📝 Commits (2) - [`caabd7d`](https://github.com/apple/pkl/commit/caabd7df6fae6fc3e71991294c1399bca1f1ebea) Adjust formatting of line comments in lets - [`8e8e8d8`](https://github.com/apple/pkl/commit/8e8e8d821910379ae9261897ca23b7dd506dd6d3) Address PR comments ### 📊 Changes **3 files changed** (+95 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt` (+9 -5) 📝 `pkl-formatter/src/test/files/FormatterSnippetTests/input/comment-interleaved.pkl` (+43 -0) 📝 `pkl-formatter/src/test/files/FormatterSnippetTests/output/comment-interleaved.pkl` (+43 -0) </details> ### 📄 Description Fixes an issue where line comments preceding let bodies are not indented. Turn this: ```pkl bar3 = let (bar = new Dynamic {}) // some coment (bar) { qux = 4 } ``` Into this: ```pkl bar3 = let (bar = new Dynamic {}) // some coment (bar) { qux = 4 } ``` --- <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:03 +01:00
adam closed this issue 2025-12-30 01:28:03 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#973