-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Seems like incorrect break for chained property and method calls #956
Comments
The breaking of long chains uses the same logic as prettier, although it looks like there is a bug with the 1st case. Prettier does this with it. There is definitely a bug with the current way csharpier breaks it. someLongNameField
.Method0()
.Property0.Property1.Property2.Method1()
.Property3.Array1[1].Property4.Property5.Method2()
.Method3("some input")
.Method2()
.Property6.Property7.Array2[2].Property8.Method4("some input").Property9
.Property10; The 2nd case ends up like this in prettier _someResolver.Resolve(
(raw.Settings.AttributeTemplate.Settings.OutputSettings[raw.TestFramework]
.AttributeTemplate.Settings.AttributeTemplate.Settings.OutputSettings[
raw.TestFramework
].AttributeTemplate,
{
ClassName: className,
TestClassName: raw.MethodSymbol.ContainingType.Name,
TestName: raw.MethodSymbol.Name,
}),
); If I remember correctly, the logic tries to group property accessors onto a single line if they fit. It seems worth exploring breaking them instead. At the very least fixing the first case, which seems to be a bug. #451 may be related. |
In https://playground.csharpier.com/ I have played around with chains and following does not seem right:
Input:
output:
property and method chains are broken differently.
Other example:
input
output:
The text was updated successfully, but these errors were encountered: