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

ParenthesizedExpression breaking inconsistently #921

Open
belav opened this issue Jun 28, 2023 · 1 comment · May be fixed by #1115
Open

ParenthesizedExpression breaking inconsistently #921

belav opened this issue Jun 28, 2023 · 1 comment · May be fixed by #1115
Milestone

Comments

@belav
Copy link
Owner

belav commented Jun 28, 2023

Having a single invocation on a ParenthesizedExpression that is too long causes it to break like below. It would look better if it stayed consistent with the second example.

(
    someObject as SomeLongType__________________________________________
).CallMethod();

(someObject as SomeLongType__________________________________________)
    .CallMethod()
    .CallMethod();

A potential solution is "never break ParenthesizedExpression unless its contents break"

@jods4
Copy link

jods4 commented Aug 16, 2023

Sounds like a good rule.
It's inconsistent and adds an additional line of code for just a single bracket!

The first example would look better as

(someObject as SomeLongType__________________________________________)
  .CallMethod();

Applying the same logic (don't break unless its contents break) to if (..), while (..), catch (..), (..) => would fix #924

@belav belav modified the milestones: 0.27.0, Planned Dec 26, 2023
@belav belav linked a pull request Jan 7, 2024 that will close this issue
@belav belav modified the milestones: 0.27.0, Planned Jan 15, 2024
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