Original PR: https://github.com/apple/pkl/pull/1252 Author: @bioball Created: 10/23/2025 Status: ✅ Merged Merged: 10/25/2025 Merged by: @bioball
Base: main ← Head: qualified-access-chain-formatting-2
main
qualified-access-chain-formatting-2
6292719
8c074d1
022a1b3
7 files changed (+275 additions, -53 deletions)
📝 pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt (+143 -33) ➕ pkl-formatter/src/test/files/FormatterSnippetTests/input/expr-chain-grouping.pkl (+31 -0) ➕ pkl-formatter/src/test/files/FormatterSnippetTests/output/expr-chain-grouping.pkl (+65 -0) 📝 pkl-parser/src/main/java/org/pkl/parser/GenericParser.java (+15 -10) 📝 pkl-parser/src/main/java/org/pkl/parser/syntax/generic/NodeType.java (+1 -0) 📝 pkl-parser/src/test/kotlin/org/pkl/parser/GenericSexpRenderer.kt (+4 -4) 📝 pkl-parser/src/test/kotlin/org/pkl/parser/SexpRenderer.kt (+16 -6)
pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt
pkl-formatter/src/test/files/FormatterSnippetTests/input/expr-chain-grouping.pkl
pkl-formatter/src/test/files/FormatterSnippetTests/output/expr-chain-grouping.pkl
pkl-parser/src/main/java/org/pkl/parser/GenericParser.java
pkl-parser/src/main/java/org/pkl/parser/syntax/generic/NodeType.java
pkl-parser/src/test/kotlin/org/pkl/parser/GenericSexpRenderer.kt
pkl-parser/src/test/kotlin/org/pkl/parser/SexpRenderer.kt
This adjusts formatting of qualified access chains so that leading dot calls are kept in the same line if possible.
Formatting rules:
If there is a call chain that ends with the only method call, prefer to only wrap the argument list. Render this:
prop = foo.baz(new { foo = 1 })
Instead of:
prop = foo .baz(new { foo = 1 })
If the method call is interspersed within the chain, prefer to wrap before the first method call: Render this:
prop = foo.bar .baz(new { foo = 1 }) .qux()
prop = foo .bar .baz(new { foo = 1 }) .qux()
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
No dependencies set.
The note is not visible to the blocked user.
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/1252
Author: @bioball
Created: 10/23/2025
Status: ✅ Merged
Merged: 10/25/2025
Merged by: @bioball
Base:
main← Head:qualified-access-chain-formatting-2📝 Commits (3)
6292719Adjust formatting of qualified access chains8c074d1Update pkl-parser/src/main/java/org/pkl/parser/GenericParser.java022a1b3Address PR comments📊 Changes
7 files changed (+275 additions, -53 deletions)
View changed files
📝
pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt(+143 -33)➕
pkl-formatter/src/test/files/FormatterSnippetTests/input/expr-chain-grouping.pkl(+31 -0)➕
pkl-formatter/src/test/files/FormatterSnippetTests/output/expr-chain-grouping.pkl(+65 -0)📝
pkl-parser/src/main/java/org/pkl/parser/GenericParser.java(+15 -10)📝
pkl-parser/src/main/java/org/pkl/parser/syntax/generic/NodeType.java(+1 -0)📝
pkl-parser/src/test/kotlin/org/pkl/parser/GenericSexpRenderer.kt(+4 -4)📝
pkl-parser/src/test/kotlin/org/pkl/parser/SexpRenderer.kt(+16 -6)📄 Description
This adjusts formatting of qualified access chains so that leading dot calls are kept in the same line if possible.
Formatting rules:
If there is a call chain that ends with the only method call, prefer to only wrap the argument list. Render this:
Instead of:
If the method call is interspersed within the chain, prefer to wrap before the first method call: Render this:
Instead of:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.