-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
MultilineBlockBracketsOnSameColumn not working properly when calling base constructors #852
Comments
@nojaf In the tests I can see that sometimes the first element of a record is expected to be on the same line as the opening bracket. For example: fantomas/src/Fantomas.Tests/MultilineBlockBracketsOnSameColumnRecordTests.fs Lines 574 to 583 in 694f4c3
Is this expected? If so, could you clarify in which cases this behaviour is expected? |
Remembering the github issue that inspired the MultilineBlockBracketsOnSameColumn setting, I'd say that any person that enables this expects always to have things like:
So, with this setting enabled, nothing should be in the same line as the opening/closing braces. |
@knocte this is by design. See unit test . In alignment with how update records work. |
Those unit tests and the update records cases have more lines. Look at my original testcase, it's just an inherit line, not more lines. If anything, it should put the closing brace in the same line. So, either this expected result:
or this one:
but not this:
|
|
But this is not a record! I use short MaxRecordWidth (in fact I set it to 0 in my project) because I don't like the use of
I guess you actually meant
...doesn't strike me as something sane at all. I hope you agree that we need to fix it (even if we disagree on the way to fix it). |
It actually is from AST perspective. I guess we can add an exception when the |
@nojaf How about if we use the Context to check if we are inside a |
@nojaf AFAIK there can also be values declared even when
This would be matched as regular record again as the empty list in line 57 would (I believe?) not be empty anymore. |
When empty I would go for: { inherit CommunicationUnsuccessfulException(message) } when not empty: {
inherit CommunicationUnsuccessfulException(message)
SomeA = ThingA
SomeB = ThingB
} |
Issue created from fantomas-online
Please describe here fantomas problem you encountered
Code
Result
With MultilineBlockBracketsOnSameColumn disabled:
With MultilineBlockBracketsOnSameColumn enabled:
Expected results (with MultilineBlockBracketsOnSameColumn enabled):
Options
Fantomas Next - 4.0.0-alpha-001-1/1/1990
IndentSpaceNum
4
PageWidth
120
SemicolonAtEndOfLine
false
SpaceBeforeParameter
true
SpaceBeforeLowercaseInvocation
true
SpaceBeforeUppercaseInvocation
false
SpaceBeforeClassConstructor
false
SpaceBeforeMember
false
SpaceBeforeColon
false
SpaceAfterComma
true
SpaceBeforeSemicolon
false
SpaceAfterSemicolon
true
IndentOnTryWith
false
SpaceAroundDelimiter
true
MaxIfThenElseShortWidth
40
MaxInfixOperatorExpression
50
MaxRecordWidth
40
MaxArrayOrListWidth
40
MaxLetBindingWidth
40
MultilineBlockBracketsOnSameColumn
true
NewlineBetweenTypeDefinitionAndMembers
false
KeepIfThenInSameLine
false
StrictMode
false
The text was updated successfully, but these errors were encountered: