Allow undentation in method and constructor calls
I propose we allow undentation in method and constructor calls without emitting a warning.
The existing way of approaching this problem in F# is that the arguments need to be placed more on the right side of the equal and the caller subject.
Sample:
This is possible today:
let x = System.DateTime(
year = 2020,
month = 12,
day = 1)
also this:
let x =
System.DateTime(
year = 2020,
month = 12,
day = 1)
and:
let x =
System.DateTime(
year = 2020,
month = 12,
day = 1
)
This gives a warning (FS0058):
let x = System.DateTime(
year = 2020,
month = 12,
day = 1)
and likewise:
let x = System.DateTime(
year = 2020,
month = 12,
day = 1
)
also this gives a warning (but is okay in constructors via dotnet/fsharp#6808):
let x = System.DateTime(year = 2020,
month = 12,
day = 1)
Sidenote:
Also this way of defining constructors or methods gives a warning:
type Foo (
y: int,
x: int) =
member self.Bar(
a: int,
b: int) =
()
but this is okay:
type Foo (y: int,
x: int) =
member self.Bar(a: int,
b: int) =
()
which was mentioned in #724 (comment) but apparently didn't made it into the PR...
Pros and Cons
The advantages of making this adjustment to F# is a visually more pleasant way of calling methods. Style and elegance is a very subjective view but it goes hand in hand with the relaxed indentation for lists and arrays introduced in F# 4.5 and the "elmish" style formatting.
The disadvantages of making this adjustment to F# are: (too much?) choices!
Extra information
Estimated cost (XS, S, M, L, XL, XXL): S?
Related suggestions: (put links to related suggestions here)
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
For Readers
If you would like to see this issue implemented, please click the 👍 emoji on this issue. These counts are used to generally order the suggestions by engagement.
Allow undentation in method and constructor calls
I propose we allow undentation in method and constructor calls without emitting a warning.
The existing way of approaching this problem in F# is that the arguments need to be placed more on the right side of the equal and the caller subject.
Sample:
This is possible today:
also this:
and:
This gives a warning (FS0058):
and likewise:
also this gives a warning (but is okay in constructors via dotnet/fsharp#6808):
Sidenote:
Also this way of defining constructors or methods gives a warning:
but this is okay:
which was mentioned in #724 (comment) but apparently didn't made it into the PR...
Pros and Cons
The advantages of making this adjustment to F# is a visually more pleasant way of calling methods. Style and elegance is a very subjective view but it goes hand in hand with the relaxed indentation for lists and arrays introduced in F# 4.5 and the "elmish" style formatting.
The disadvantages of making this adjustment to F# are: (too much?) choices!
Extra information
Estimated cost (XS, S, M, L, XL, XXL): S?
Related suggestions: (put links to related suggestions here)
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
For Readers
If you would like to see this issue implemented, please click the 👍 emoji on this issue. These counts are used to generally order the suggestions by engagement.