@@ -58,8 +58,8 @@ let ``+> will compose two functions`` () =
5858let ``partially application when composing function`` () =
5959 // We can write the previous example in a more concise way.
6060 // Because of partial application in F#: https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/functions/#partial-application-of-arguments
61- let f = !- " f" // signature of f remains the same: Context -> Context
62- let g = !- " and g" // signature of g remains the same: Context -> Context
61+ let f = !- " f" // signature of f remains the same: Context -> Context
62+ let g = !- " and g" // signature of g remains the same: Context -> Context
6363 let h = f +> g // signature of h remains the same: Context -> Context
6464
6565 // Conceptually, you should really read `+>` as and then.
@@ -88,7 +88,7 @@ let ``the Context module has a lot of helper functions`` () =
8888
8989[<Test>]
9090let ``some helper function are clever like sepSpace`` () =
91- let f = !- " a" +> sepSpace +> sepSpace +> !- " b"
91+ let f = !- " a" +> sepSpace +> sepSpace +> !- " b"
9292
9393 let contextBefore : Context = Context.Default
9494 let contextAfter : Context = f contextBefore
@@ -102,7 +102,7 @@ let ``some helper function are clever like sepSpace`` () =
102102
103103[<Test>]
104104let ``other helper function respect configuration settings`` () =
105- let f = !- " a" +> sepColon +> !- " b"
105+ let f = !- " a" +> sepColon +> !- " b"
106106 let defaultConfig : Context = Context.Default
107107 // The `FormatConfig` is present in the `Context`.
108108 let configWithSpaceBeforeTrue =
@@ -125,7 +125,7 @@ let ``traversing collections`` () =
125125 let items = [ 2 ; 3 ; 4 ]
126126 // The `col` function will traverse the collection and apply the first function between elements and the last function for each individual element.
127127 let f ( items : int seq ) : Context -> Context =
128- col (!- " + " ) items ( fun ( item : int ) -> !- $" %i {item}" )
128+ col (!- " + " ) items ( fun ( item : int ) -> !- $" %i {item}" )
129129
130130 // Note that there are some variants of `col` that can be used to process a collection in a different way.
131131 // coli, colEx, ...
@@ -141,7 +141,7 @@ let ``newlines and indentation`` () =
141141 // Indentation only kick in on the next line, this is something to be aware of.
142142 // `sepNln` is a helper function that will add a newline.
143143
144- let f = !- " first line" +> sepNln +> indent +> !- " second line"
144+ let f = !- " first line" +> sepNln +> indent +> !- " second line"
145145 // The dump function will respect the newline from the configuration.
146146 // For this test we will set it to `EndOfLineStyle.LF`
147147 let ctx =
@@ -154,14 +154,14 @@ let ``newlines and indentation`` () =
154154 Assert.AreEqual( " first line\n second line" , code)
155155 // There is no indentation because that would only kick in after the second line.
156156
157- let g = !- " first line" +> indent +> sepNln +> !- " second line" +> unindent
157+ let g = !- " first line" +> indent +> sepNln +> !- " second line" +> unindent
158158 let indentedCode = g ctx |> dump
159159 Assert.AreEqual( " first line\n second line" , indentedCode)
160160
161161 // Using `indent` typically goes together with and `unindent` call.
162162 // This is a very common pattern in CodePrinter, so the use of `indentSepNlnUnindent` is encouraged.
163163 // Forgetting to `unindent` can be a nasty bug in Fantomas.
164- let h = !- " first line" +> indentSepNlnUnindent (!- " second line" )
164+ let h = !- " first line" +> indentSepNlnUnindent (!- " second line" )
165165 let indentedCtx = h ctx
166166 let indentedCode = dump indentedCtx
167167 Assert.AreEqual( " first line\n second line" , indentedCode)
@@ -176,8 +176,8 @@ let ``newlines and indentation`` () =
176176let ``trying multiple code paths`` () =
177177 // Sometimes we want to try and fit everything in a single line.
178178 // And have a fallback behavior when that is not possible.
179- let short = !- " This fits on a single line"
180- let long = !- " This fits on" +> sepNln +> !- " two lines"
179+ let short = !- " This fits on a single line"
180+ let long = !- " This fits on" +> sepNln +> !- " two lines"
181181 // `expressionFitsOnRestOfLine` will try the first expression and if it doesn't fit, it will try the second expression.
182182 // All the events of the first expression will be remove from the context when it needs to fallback to the second expression.
183183 let f = expressionFitsOnRestOfLine short long
@@ -242,7 +242,7 @@ let a =
242242 let genExpr ( expr : Expr ) =
243243 match expr with
244244 | Expr.Ident identNode -> !- identNode.Text
245- | _ -> !- " error"
245+ | _ -> !- " error"
246246
247247 let f ( genExpr : Expr -> Context -> Context ) ( tree : Oak ) : Context -> Context =
248248 match tree.ModulesOrNamespaces.[ 0 ]. Declarations.[ 0 ] with
@@ -254,8 +254,8 @@ let a =
254254 | Choice1Of2 functionNameNode ->
255255 match functionNameNode.Content with
256256 | [ IdentifierOrDot.Ident node ] -> !- node.Text
257- | _ -> !- " error"
258- | Choice2Of2 _ -> !- " error"
257+ | _ -> !- " error"
258+ | Choice2Of2 _ -> !- " error"
259259
260260 let genEq = !- bindingNode.Equals.Text
261261
@@ -267,7 +267,7 @@ let a =
267267 // Try to add a space and print the expression.
268268 // If the expression is multiline add indent, newline, print the expression and unindent.
269269 +> sepSpaceOrIndentAndNlnIfExpressionExceedsPageWidth ( genExpr bindingNode.Expr)
270- | _ -> !- " error"
270+ | _ -> !- " error"
271271
272272 let ctx =
273273 { Context.Default with
@@ -302,10 +302,10 @@ let a =
302302 // If found we check the content and try to print the comment text followed by a newline
303303 match triviaNode.Content with
304304 | CommentOnSingleLine comment -> !- comment +> sepNln
305- | _ -> !- " error"
305+ | _ -> !- " error"
306306
307307 firstComment +> !- identNode.Text
308- | _ -> !- " error"
308+ | _ -> !- " error"
309309
310310 let codeWithTriviaPrinting = f genExprWithTrivia tree ctx |> dump
311311 Assert.AreEqual( " let a =\n // code comment\n b" , codeWithTriviaPrinting)
@@ -379,7 +379,7 @@ let b = 2
379379
380380 // print trivia before BindingNode
381381 enterNode node
382- +> !- " let"
382+ +> !- " let"
383383 +> sepSpace
384384 +> !- name.Text
385385 +> sepEq
@@ -393,7 +393,7 @@ let b = 2
393393 +> sepNln
394394 +> genBinding b
395395
396- | _ -> !- " error"
396+ | _ -> !- " error"
397397
398398 let ctx =
399399 { Context.Default with
@@ -438,7 +438,7 @@ let b = 2
438438
439439 // print trivia before BindingNode
440440 enterNode node
441- +> !- " let"
441+ +> !- " let"
442442 +> sepSpace
443443 +> !- name.Text
444444 +> sepEq
@@ -456,7 +456,7 @@ let b = 2
456456 +> sepNlnUnlessBindingHasTrivia b
457457 +> genBinding b
458458
459- | _ -> !- " error"
459+ | _ -> !- " error"
460460
461461 let finalCode = g tree ctx |> dump
462462 Assert.AreEqual( " let a = 1\n\n let b = 2" , finalCode)
@@ -467,7 +467,7 @@ let ``locking the indentation at a fixed column`` () =
467467 // This is typically to produce valid F# due to the offset rules.
468468 let f =
469469 sepOpenT
470- +> atCurrentColumn (!- " first line" +> sepNln +> !- " second line" )
470+ +> atCurrentColumn (!- " first line" +> sepNln +> !- " second line" )
471471 +> sepCloseT
472472
473473 let ctxBefore =
0 commit comments