-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-Won't FixThe issue won't be fixed, possibly due to compatibility reason.The issue won't be fixed, possibly due to compatibility reason.WG-Languageparser, language semanticsparser, language semantics
Description
Summary of the new feature/enhancement
Some languages like Rust
allow a trailing comma in a parameter or argument list. In PowerShell, this would look like:
param($a,)
Without allowing a trailing comma, some people resort to formatting like the following:
param( [Parameter(Mandatory)][string] $Thing
, [Parameter()][string] $AnotherThing
, [Parameter()][string] $YetAnotherThing
)
The "leading" comma syntax gets used to minimize the lines changed when adding new parameters.
If a trailing comma was allowed, this style would be replaced with:
param( [Parameter(Mandatory)][string] $Thing,
[Parameter()][string] $AnotherThing,
[Parameter()][string] $YetAnotherThing,
)
This could also be applied to method argument lists:
$something.Insert($offset, $value,)
This usage might see less use than in parameter lists though as parameter lists usually span multiple lines whereas argument lists often do not.
rjmholt, vexx32, SeeminglyScience, mklement0, jayvdb and 15 more
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-Won't FixThe issue won't be fixed, possibly due to compatibility reason.The issue won't be fixed, possibly due to compatibility reason.WG-Languageparser, language semanticsparser, language semantics