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

String Concatentation (or binary expression) should indent in method invocation #337

Open
belav opened this issue Jun 26, 2021 · 4 comments
Labels

Comments

@belav
Copy link
Owner

belav commented Jun 26, 2021

class ClassName
{
    void MethodName()
    {
        var result = await ProcessUtil.RunAsync(
            commonTestArgs
            + " --TestCaseFilter:\"Quarantined!=true|Quarantined=false\"              ",
            environmentVariables: EnvironmentVariables
        );
    }
}
// should be
class ClassName
{
    void MethodName()
    {
        var result = await ProcessUtil.RunAsync(
            commonTestArgs
                + " --TestCaseFilter:\"Quarantined!=true|Quarantined=false\"              ",
            environmentVariables: EnvironmentVariables
        );
    }
}
@respel
Copy link

respel commented Jun 26, 2021

Should we because we don't indent other binary operators such as && or ||?

@belav
Copy link
Owner Author

belav commented Jun 27, 2021

I think we'd want to indent other binary operators as well. Prettier does this

callMethod(
  first____________,
  secondWithAdd +
    someLongName__________________________________________________________,
  thirdWithAnd &&
    someLongName__________________________________________________________
);

@belav belav added type:bug Something isn't working area:formatting labels Jun 27, 2021
@belav
Copy link
Owner Author

belav commented Jul 11, 2021

SwitchExpressions will hopefully be handled by this too

return someValue switch
{
    OneMore
      => "someStrings"
      + "moreStrings"
      + "andMoreStrings_________________________________________"
};

// should be
return someValue switch
{
    OneMore
      => "someStrings"
          + "moreStrings"
          + "andMoreStrings_________________________________________"
};

// or if possible use an align 2 somehow instead of an indent
return someValue switch
{
    OneMore
      => "someStrings"
        + "moreStrings"
        + "andMoreStrings_________________________________________"
};

@belav
Copy link
Owner Author

belav commented Jul 19, 2021

#37 handled most of this, but if we want the align 2 called out in the above comment, we'll have to do some additional work.

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

No branches or pull requests

2 participants