diff --git a/src/Fantomas.Tests/LetBindingTests.fs b/src/Fantomas.Tests/LetBindingTests.fs index c583bdb57a..5de48410e1 100644 --- a/src/Fantomas.Tests/LetBindingTests.fs +++ b/src/Fantomas.Tests/LetBindingTests.fs @@ -467,4 +467,33 @@ let genSigModuleDeclList astContext node = (col sepNln xs (genSigModuleDecl astContext) +> sepXsAndYs +> genSigModuleDeclList astContext ys) ctx -""" \ No newline at end of file +""" + +[] +let ``determine lower or uppercase in DotGet, 729`` () = + formatSourceString false """namespace Foo + +open System.Linq + +module Bar = + let Baz () = + for foo in bar().OfType() do + printf "baz" + + for foo in bar().meh() do + printf "baz" +""" config + |> prepend newline + |> should equal """ +namespace Foo + +open System.Linq + +module Bar = + let Baz () = + for foo in bar().OfType() do + printf "baz" + + for foo in bar().meh () do + printf "baz" +""" diff --git a/src/Fantomas/SourceParser.fs b/src/Fantomas/SourceParser.fs index ff923f996e..fb828ff53f 100644 --- a/src/Fantomas/SourceParser.fs +++ b/src/Fantomas/SourceParser.fs @@ -1362,6 +1362,8 @@ let (|UppercaseSynExpr|LowercaseSynExpr|) (synExpr:SynExpr) = | Some lp -> upperOrLower lp | None -> LowercaseSynExpr + | SynExpr.DotGet (_,_,LongIdentWithDots(lid),_) -> upperOrLower lid + | _ -> failwithf "cannot determine if synExpr %A is uppercase or lowercase" synExpr let rec isEmptySynSimplePats (ssp:SynSimplePats) =