Originally created by @HT154 on GitHub (Jul 21, 2025).
Many languages—Swift included—allow trailing commas between comma-separated syntax elements.
Allowing this means that adding elements to the end or reordering elements doesn't incur additional diff to manage the comma absence on the new/former final element.
These syntax rules in Pkl should allow trailing commas:
Function parameter lists (method definitions)
Argument lists (method calls)
Type argument lists (in declared type names)
Type parameter lists (in class/module headers)
Function type parameter lists (function type annotations)
Type constraint lists
Object body parameter lists (sugar'd lambdas)
Pkl's formatter should likely enforce trailing commas are present when the containing syntax rules are broken over multiple lines.
This will require support in Pkl's various grammars (pkl-intellij, tree-sitter-pkl).
This should probably also affect the pkl.experimental.syntax library in pkl-pantry.
Originally created by @HT154 on GitHub (Jul 21, 2025).
Many languages—Swift included—allow trailing commas between comma-separated syntax elements.
Allowing this means that adding elements to the end or reordering elements doesn't incur additional diff to manage the comma absence on the new/former final element.
These syntax rules in Pkl should allow trailing commas:
* Function parameter lists (method definitions)
* Argument lists (method calls)
* Type argument lists (in declared type names)
* Type parameter lists (in class/module headers)
* Function type parameter lists (function type annotations)
* Type constraint lists
* Object body parameter lists (sugar'd lambdas)
Pkl's formatter should likely enforce trailing commas are present when the containing syntax rules are broken over multiple lines.
This will require support in Pkl's various grammars (pkl-intellij, tree-sitter-pkl).
This should probably also affect the `pkl.experimental.syntax` library in pkl-pantry.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @HT154 on GitHub (Jul 21, 2025).
Many languages—Swift included—allow trailing commas between comma-separated syntax elements.
Allowing this means that adding elements to the end or reordering elements doesn't incur additional diff to manage the comma absence on the new/former final element.
These syntax rules in Pkl should allow trailing commas:
Pkl's formatter should likely enforce trailing commas are present when the containing syntax rules are broken over multiple lines.
This will require support in Pkl's various grammars (pkl-intellij, tree-sitter-pkl).
This should probably also affect the
pkl.experimental.syntaxlibrary in pkl-pantry.