belav / csharpier

CSharpier is an opinionated code formatter for c#.
https://csharpier.com
MIT License
1.43k stars 99 forks source link

Collection expressions should be supported #1107

Closed ShawnTheBeachy closed 11 months ago

ShawnTheBeachy commented 11 months ago

Input:

public sealed class Fruit
{
    public List<string> Colors { get; init; } = [];
}

Expected behavior: This should work, but using collection expressions breaks CSharpier. The file will not be formatted.

belav commented 11 months ago

Are you on an older version? Collection expressions support was added in at least 0.26, possibly somewhat supported before that.

ShawnTheBeachy commented 11 months ago

Oh... I was updating my global install, but not the project-level install 🤦‍♂️. Working now, thanks!

belav commented 11 months ago

Oh... I was updating my global install, but not the project-level install 🤦‍♂️. Working now, thanks!

No problem! My co-worker ran into something related last week, apparently dotnet-csharpier will run the global install and dotnet csharpier will run the local install, and those versions were mismatched on his system.