-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Possible wrong indentation for functions with parameters over multiple lines #868
Comments
@nojaf Is it OK if I begin to fix this as proposed before we get a response from dotnet? |
Get a response? The maximum they could do is propose a compiler change to make it not spit the warning (even if I bet that they will just change the style-guide), but that would take ages until fantomas users get the fix, so I think fantomas should adopt the warning-less approach for now. |
@Bobface please wait, I'm still checking with some other people. |
@nojaf given that this problem was introduced in the latest alphas (regression), can we get clarity before 4.0 final is released? to give enough room to fix |
@knocte I discussed this with @jindraivanek and we came up with a proposal. |
Outcome to resolve these issues would be the following: type VersionMismatchDuringDeserializationException
(message: string,
innerException: System.Exception)
=
inherit System.Exception(message, innerException)
type C() =
member _.LongMethodWithLotsOfParameters
(aVeryLongType: int,
aSecondVeryLongType: int,
aThirdVeryLongType: int)
: int
=
aVeryLongType + aSecondVeryLongType + aThirdVeryLongType I'm willing to tackle these myself, once time permits it. |
@knocte I got a rely on the MS style guide. |
That's good stuff, I actually like both MS and GR solutions, not sure which one I'll end up using. |
Issue created from fantomas-online
The parameters to the function might have invalid indentation after formatting. The problem is that the formatted result below adheres to the F#-Styleguide (see Place parameters on a new line for long member definitions) while the compiler prints indentation warnings when compiling:
(roughly translated)
The compiler wants the parameters to be aligned with the braces, for example:
The first parameter can either be in a new line or the same line as the opening brace. The equals sign can either be on the same line as the closing brace or on a new line. I personally see the example above as the cleanest way.
Code
Result
Options
Fantomas Master at 05/24/2020 18:24:52 - c23aa74
IndentSpaceNum
4
PageWidth
80
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
false
NewlineBetweenTypeDefinitionAndMembers
false
KeepIfThenInSameLine
false
StrictMode
false
The text was updated successfully, but these errors were encountered: