csharpier icon indicating copy to clipboard operation
csharpier copied to clipboard

Extra indent when call method on RawStringLiteral

Open Rudomitori opened this issue 1 year ago • 1 comments

Input:

var fillingProgress = calculator.Calculate(
    """
    {
      "TextField":  "",
      "NumberField": "",
      "DateRangeField":  "",
      "TimeField": "",
      "RadioGroupField":  "",
      "DropdownField": "",
      "CheckBoxField":  "",
      "CheckBoxGroupField": "",
      "TagInputField":  "",
      "FileField": "",
      "Weight":  "",
      "Height": ""
    }
    """.ToJsonObject()!,
    []
);

Output:

var fillingProgress = calculator.Calculate(
    """
        {
          "TextField":  "",
          "NumberField": "",
          "DateRangeField":  "",
          "TimeField": "",
          "RadioGroupField":  "",
          "DropdownField": "",
          "CheckBoxField":  "",
          "CheckBoxGroupField": "",
          "TagInputField":  "",
          "FileField": "",
          "Weight":  "",
          "Height": ""
        }
        """.ToJsonObject()!,
    []
);

Expected behavior:

var fillingProgress = calculator.Calculate(
    """
    {
      "TextField":  "",
      "NumberField": "",
      "DateRangeField":  "",
      "TimeField": "",
      "RadioGroupField":  "",
      "DropdownField": "",
      "CheckBoxField":  "",
      "CheckBoxGroupField": "",
      "TagInputField":  "",
      "FileField": "",
      "Weight":  "",
      "Height": ""
    }
    """.ToJsonObject()!,
    []
);

Rudomitori avatar Feb 09 '24 07:02 Rudomitori

It gets even worse if you call several methods in chain Input:

var fillingProgress = calculator.Calculate(
    """
    {
      "TextField":  "",
      "NumberField": "",
      "DateRangeField":  "",
      "TimeField": "",
      "RadioGroupField":  "",
      "DropdownField": "",
      "CheckBoxField":  "",
      "CheckBoxGroupField": "",
      "TagInputField":  "",
      "FileField": "",
      "Weight":  "",
      "Height": ""
    }
    """.ToJsonObject()!.Select(x => x),
    []
);

Output:

var fillingProgress = calculator.Calculate("""
        {
          "TextField":  "",
          "NumberField": "",
          "DateRangeField":  "",
          "TimeField": "",
          "RadioGroupField":  "",
          "DropdownField": "",
          "CheckBoxField":  "",
          "CheckBoxGroupField": "",
          "TagInputField":  "",
          "FileField": "",
          "Weight":  "",
          "Height": ""
        }
        """.ToJsonObject()!.Select(x => x), []);

Expected:

var fillingProgress = calculator.Calculate(
    """
    {
      "TextField":  "",
      "NumberField": "",
      "DateRangeField":  "",
      "TimeField": "",
      "RadioGroupField":  "",
      "DropdownField": "",
      "CheckBoxField":  "",
      "CheckBoxGroupField": "",
      "TagInputField":  "",
      "FileField": "",
      "Weight":  "",
      "Height": ""
    }
    """.ToJsonObject()!
        .Select(x => x),
    []
);

Rudomitori avatar Feb 09 '24 07:02 Rudomitori