belav / csharpier

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

Adds additional space before each member access in verbatim interpolated multiline string #1358

Closed ulrichstark closed 2 weeks ago

ulrichstark commented 1 month ago

Input:

class Utils
{
    string GetTypeName(object value)
    {
        return $@"
                  {value.GetType().Name} text text text text text text text text text text text text";
    }
}

Output:

class Utils
{
    string GetTypeName(object value)
    {
        return $@"
                  {value .GetType() .Name} text text text text text text text text text text text text";
    }
}

Expected behavior:

CSharpier shouldn't add a space after value and GetType(). To replicate, paste the input code into https://playground.csharpier.com/ and leave options to default (print width = 100). The output is correct when removing one "text" from the string.