Skip to content

Commit 6aec48a

Browse files
committed
Remove MaxDotGetExpressionWidth (#3138)
* Remove MaxDotGetExpressionWidth * Fix remaining tests
1 parent ebb9601 commit 6aec48a

23 files changed

+75
-202
lines changed

docs/docs/end-users/Configuration.fsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -729,28 +729,6 @@ fsharp_max_function_binding_width = 10
729729
"""
730730
(*** include-output ***)
731731

732-
(**
733-
<fantomas-setting green></fantomas-setting>
734-
### fsharp_max_dot_get_expression_width
735-
<copy-to-clipboard text="fsharp_max_dot_get_expression_width = 100"></copy-to-clipboard>
736-
737-
Control the maximum width for which (nested) [SynExpr.DotGet](https://fsharp.github.io/fsharp-compiler-docs/reference/fsharp-compiler-syntax-synexpr.html#DotGet) expressions should be in one line.
738-
*)
739-
740-
(*** hide ***)
741-
printfn
742-
$"# Default\n{toEditorConfigName (nameof FormatConfig.Default.MaxDotGetExpressionWidth)} = {FormatConfig.Default.MaxDotGetExpressionWidth}"
743-
(*** include-output ***)
744-
745-
formatCode
746-
"""
747-
let job = JobBuilder.UsingJobData(jobDataMap).Create<WrapperJob>().Build()
748-
"""
749-
"""
750-
fsharp_max_dot_get_expression_width = 60
751-
"""
752-
(*** include-output ***)
753-
754732
(**
755733
<fantomas-setting green gr></fantomas-setting>
756734
### fsharp_multiline_bracket_style

src/Fantomas.Core.Tests/ChainTests.fs

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ let ``identifier dot appUnit dot typed appUnit `` () =
181181
"""
182182
A.B().C<'d>()
183183
"""
184-
{ config with
185-
MaxDotGetExpressionWidth = 0 }
184+
{ config with MaxLineLength = 10 }
186185
|> prepend newline
187186
|> should
188187
equal
@@ -198,8 +197,7 @@ let ``identifier dot appUnit dot typed identifier `` () =
198197
"""
199198
A.B().C<'d>
200199
"""
201-
{ config with
202-
MaxDotGetExpressionWidth = 0 }
200+
{ config with MaxLineLength = 10 }
203201
|> prepend newline
204202
|> should
205203
equal
@@ -215,8 +213,7 @@ let ``identifier dot identifier dot appExpr dot appUnit dot index expr`` () =
215213
"""
216214
A.B.C(D).E().[0]
217215
"""
218-
{ config with
219-
MaxDotGetExpressionWidth = 0 }
216+
{ config with MaxLineLength = 10 }
220217
|> prepend newline
221218
|> should
222219
equal
@@ -233,8 +230,7 @@ let ``identifier dot identifier dot appExpr dot identifier dot index expr`` () =
233230
"""
234231
A.B.C(D).E.[0]
235232
"""
236-
{ config with
237-
MaxDotGetExpressionWidth = 0 }
233+
{ config with MaxLineLength = 10 }
238234
|> prepend newline
239235
|> should
240236
equal
@@ -288,8 +284,7 @@ Map
288284
.empty<_, obj>
289285
.Add("headerAction", modifyHeader.Action.ArmValue)
290286
"""
291-
{ config with
292-
MaxDotGetExpressionWidth = 0 }
287+
{ config with MaxLineLength = 55 }
293288
|> prepend newline
294289
|> should
295290
equal
@@ -310,7 +305,7 @@ let d = Duck()
310305
311306
d.Duck.Duck.Duck.Goose().Duck.Goose().Duck.Duck.Goose().Duck.Duck.Duck.Goose().Duck.Duck.Duck.Duck.Goose()
312307
"""
313-
config
308+
{ config with MaxLineLength = 45 }
314309
|> prepend newline
315310
|> should
316311
equal
@@ -335,9 +330,7 @@ let ``very long chain with a some index expressions`` () =
335330
"""
336331
Universe.Galaxy.SolarSystem.Planet.[3].Countries.[9].People.Count
337332
"""
338-
{ config with
339-
MaxDotGetExpressionWidth = 0
340-
MaxLineLength = 50 }
333+
{ config with MaxLineLength = 50 }
341334
|> prepend newline
342335
|> should
343336
equal
@@ -353,9 +346,7 @@ let ``even longer chain with only simple links`` () =
353346
Fooooooooooo.Baaaaaaaaaaaaaaaaar.Foooooooooooooooooo.Baaaaaaaar.Basssss.Baazzzzzzzzzzzzzzzzzz.[0].Meeeeeeeeeeeeeeeeeh
354347
.Moooooooooooooooo.Booooooooooooooooooooh.Yooooooooooooooou.Meeeeeeh.Meh2
355348
"""
356-
{ config with
357-
MaxDotGetExpressionWidth = 0
358-
MaxLineLength = 50 }
349+
{ config with MaxLineLength = 50 }
359350
|> prepend newline
360351
|> should
361352
equal
@@ -426,9 +417,7 @@ Animal<
426417
"Spot"
427418
)
428419
"""
429-
{ config with
430-
MaxDotGetExpressionWidth = 0
431-
MaxLineLength = 10 }
420+
{ config with MaxLineLength = 10 }
432421
|> prepend newline
433422
|> should
434423
equal

src/Fantomas.Core.Tests/CommentTests.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,8 +1587,7 @@ Host
15871587

15881588
//
15891589
"""
1590-
{ config with
1591-
MaxDotGetExpressionWidth = 40 }
1590+
{ config with MaxLineLength = 55 }
15921591
|> prepend newline
15931592
|> should
15941593
equal

src/Fantomas.Core.Tests/CompilerDirectivesTests.fs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,7 @@ type FunctionComponent =
651651
652652
static member Foo = ()
653653
"""
654-
{ config with
655-
MaxDotGetExpressionWidth = 50 }
654+
config
656655
|> should
657656
equal
658657
"""namespace Fable.React
@@ -673,8 +672,7 @@ type FunctionComponent =
673672
let elemType =
674673
ReactBindings.React.``lazy`` (fun () ->
675674
// React.lazy requires a default export
676-
(importValueDynamic f)
677-
.``then`` (fun x -> createObj [ "default" ==> x ]))
675+
(importValueDynamic f).``then`` (fun x -> createObj [ "default" ==> x ]))
678676
679677
fun props ->
680678
ReactElementType.create
@@ -845,8 +843,7 @@ type FunctionComponent =
845843
846844
static member Foo = ()
847845
"""
848-
{ config with
849-
MaxDotGetExpressionWidth = 50 }
846+
config
850847
|> should
851848
equal
852849
"""namespace Fable.React
@@ -867,8 +864,7 @@ type FunctionComponent =
867864
let elemType =
868865
ReactBindings.React.``lazy`` (fun () ->
869866
// React.lazy requires a default export
870-
(importValueDynamic f)
871-
.``then`` (fun x -> createObj [ "default" ==> x ]))
867+
(importValueDynamic f).``then`` (fun x -> createObj [ "default" ==> x ]))
872868
873869
fun props ->
874870
ReactElementType.create
@@ -2214,7 +2210,6 @@ let loader (projectRoot: string) (siteContent: SiteContents) =
22142210
disableLiveRefresh
22152211
"""
22162212
{ config with
2217-
MaxDotGetExpressionWidth = 50
22182213
MaxInfixOperatorExpression = 50 }
22192214
|> prepend newline
22202215
|> should

src/Fantomas.Core.Tests/ComputationExpressionTests.fs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,18 +1001,13 @@ let ``let bang + do expression + let + return in ce`` () =
10011001
return Ok(user.Identity.Name, collectClaims user)
10021002
}
10031003
"""
1004-
{ config with
1005-
MaxDotGetExpressionWidth = 50 }
1004+
config
10061005
|> prepend newline
10071006
|> should
10081007
equal
10091008
"""
10101009
task {
1011-
let! config =
1012-
manager
1013-
.GetConfigurationAsync()
1014-
.ConfigureAwait(false)
1015-
1010+
let! config = manager.GetConfigurationAsync().ConfigureAwait(false)
10161011
parameters.IssuerSigningKeys <- config.SigningKeys
10171012
let user, _ = handler.ValidateToken((token: string), parameters)
10181013
return Ok(user.Identity.Name, collectClaims user)
@@ -2300,8 +2295,7 @@ aggregateResult {
23002295
}
23012296
"""
23022297
{ config with
2303-
MaxInfixOperatorExpression = 40
2304-
MaxDotGetExpressionWidth = 50 }
2298+
MaxInfixOperatorExpression = 40 }
23052299
|> prepend newline
23062300
|> should
23072301
equal

src/Fantomas.Core.Tests/ControlStructureTests.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,7 @@ let ``keep new line before for loop, 1317`` () =
723723
724724
state
725725
"""
726-
{ config with
727-
MaxDotGetExpressionWidth = 60 }
726+
{ config with MaxLineLength = 85 }
728727
|> prepend newline
729728
|> should
730729
equal

src/Fantomas.Core.Tests/CrampedMultilineBracketStyleTests.fs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -778,9 +778,7 @@ let expect =
778778
args = []
779779
commands = [] }
780780
"""
781-
{ config with
782-
MaxDotGetExpressionWidth = 50
783-
MaxArrayOrListWidth = 40 }
781+
{ config with MaxArrayOrListWidth = 40 }
784782
|> prepend newline
785783
|> should
786784
equal
@@ -1988,7 +1986,6 @@ let defaultTestOptions fwk common (o: DotNet.TestOptions) =
19881986
Configuration = DotNet.BuildConfiguration.Debug }
19891987
"""
19901988
{ config with
1991-
MaxDotGetExpressionWidth = 50
19921989
MaxInfixOperatorExpression = 50
19931990
MaxRecordWidth = 55 }
19941991
|> prepend newline

src/Fantomas.Core.Tests/DallasTests.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,7 @@ let longExpr = genExpr e +> indentSepNlnUnindent (genSynLongIdentMultiline true
14641464
14651465
fun ctx ->
14661466
isShortExpression
1467-
ctx.Config.MaxDotGetExpressionWidth
1467+
ctx.Config.Blaaaaaaaaaaaaaaaaaaaaaaaaah
14681468
shortExpr
14691469
longExpr
14701470
ctx
@@ -1477,7 +1477,7 @@ fun ctx ->
14771477
let shortExpr = genExpr e +> genSynLongIdent true sli
14781478
let longExpr = genExpr e +> indentSepNlnUnindent (genSynLongIdentMultiline true sli)
14791479
1480-
fun ctx -> isShortExpression ctx.Config.MaxDotGetExpressionWidth shortExpr longExpr ctx
1480+
fun ctx -> isShortExpression ctx.Config.Blaaaaaaaaaaaaaaaaaaaaaaaaah shortExpr longExpr ctx
14811481
"""
14821482

14831483
[<Test>]

0 commit comments

Comments
 (0)