belav / csharpier

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

Comment removed after reformatting #1300

Closed Nasicus closed 3 months ago

Nasicus commented 4 months ago

Thanks for the great work you're doing with csharpier! A small issue I just noticed:

Input:

public static class ExclusiveBrands
{
    public static readonly HashSet<int> Ids =
    [
        593, // Fish Brand
    ];
}

Output:

public static class ExclusiveBrands
{
    public static readonly HashSet<int> Ids = [593];
}

Expected behavior:

=> do not remove comment (probably leave as is?)

belav commented 4 months ago

Thanks for the kind words! This looks like an edge case of the recent logic around auto adding trailing comments, it'll be resolved in the next release.