Skip to content
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

Extract setting for preference of newline placement for computation expressions #2746

Merged
merged 19 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/docs/end-users/Configuration.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,26 @@ formatCode
MultilineBracketStyle = Stroustrup }
(*** include-output ***)

(**
<fantomas-setting name="fsharp_newline_before_multiline_computation_expression" green></fantomas-setting>

Insert a newline before a computation expression that spans multiple lines

Default = true
*)

formatCode
"""
let something =
task {
let! thing = otherThing ()
return 5
}
"""
{ FormatConfig.Default with
NewlineBeforeMultilineComputationExpression = false }
(*** include-output ***)

(**
## G-Research style

Expand Down
1 change: 1 addition & 0 deletions src/Fantomas.Core.Tests/Fantomas.Core.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<Compile Include="ListTests.fs" />
<Compile Include="CompilerDirectivesTests.fs" />
<Compile Include="ComputationExpressionTests.fs" />
<Compile Include="NewlineBeforeMultilineComputationExpressionTests.fs" />
<Compile Include="TypeProviderTests.fs" />
<Compile Include="FormattingSelectionOnlyTests.fs" />
<Compile Include="ValidationTests.fs" />
Expand Down
Loading