Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra indent when call method on RawStringLiteral #1169

Closed
Rudomitori opened this issue Feb 9, 2024 · 1 comment · Fixed by #1175
Closed

Extra indent when call method on RawStringLiteral #1169

Rudomitori opened this issue Feb 9, 2024 · 1 comment · Fixed by #1175
Milestone

Comments

@Rudomitori
Copy link
Contributor

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
Copy link
Contributor Author

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),
    []
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants