diff --git a/src/Fantomas.Benchmarks/Runners.fs b/src/Fantomas.Benchmarks/Runners.fs index f121ac5802..482fe4fe97 100644 --- a/src/Fantomas.Benchmarks/Runners.fs +++ b/src/Fantomas.Benchmarks/Runners.fs @@ -4,7 +4,7 @@ open System.IO open BenchmarkDotNet.Attributes open Fantomas.Core -let config = FormatConfig.FormatConfig.Default +let config = FormatConfig.Default [] [] diff --git a/src/Fantomas.Core.Tests/ASTTransformerTests.fs b/src/Fantomas.Core.Tests/ASTTransformerTests.fs index 4ba6ec85af..1afdff97a3 100644 --- a/src/Fantomas.Core.Tests/ASTTransformerTests.fs +++ b/src/Fantomas.Core.Tests/ASTTransformerTests.fs @@ -6,7 +6,6 @@ open FSharp.Compiler.Xml open FSharp.Compiler.Syntax open FSharp.Compiler.SyntaxTrivia open Fantomas.Core -open Fantomas.Core.FormatConfig [] let ``avoid stack-overflow in long array/list, 2485`` () = diff --git a/src/Fantomas.Core.Tests/CodePrinterHelperFunctionsTests.fs b/src/Fantomas.Core.Tests/CodePrinterHelperFunctionsTests.fs index 3e127072ac..4d3b973983 100644 --- a/src/Fantomas.Core.Tests/CodePrinterHelperFunctionsTests.fs +++ b/src/Fantomas.Core.Tests/CodePrinterHelperFunctionsTests.fs @@ -3,7 +3,6 @@ module Fantomas.Core.Tests.CodePrinterHelperFunctionsTests open NUnit.Framework open FsUnit open Fantomas.Core.Context -open Fantomas.Core.FormatConfig open Fantomas.Core open Fantomas.Core.SyntaxOak diff --git a/src/Fantomas.Core.Tests/ColMultilineItemTests.fs b/src/Fantomas.Core.Tests/ColMultilineItemTests.fs index 1c5a97b2d5..adfcd6cc42 100644 --- a/src/Fantomas.Core.Tests/ColMultilineItemTests.fs +++ b/src/Fantomas.Core.Tests/ColMultilineItemTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.ColMultilineItemTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``two short let binding should not have extra newline`` () = diff --git a/src/Fantomas.Core.Tests/CommentTests.fs b/src/Fantomas.Core.Tests/CommentTests.fs index eeb5e5cbc3..d79bc43650 100644 --- a/src/Fantomas.Core.Tests/CommentTests.fs +++ b/src/Fantomas.Core.Tests/CommentTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.CommentTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``should keep sticky-to-the-left comments after nowarn directives`` () = diff --git a/src/Fantomas.Core.Tests/ComputationExpressionTests.fs b/src/Fantomas.Core.Tests/ComputationExpressionTests.fs index f8c799bd1c..a0a2b8ed2f 100644 --- a/src/Fantomas.Core.Tests/ComputationExpressionTests.fs +++ b/src/Fantomas.Core.Tests/ComputationExpressionTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.ComputationExpressionTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``async workflows`` () = diff --git a/src/Fantomas.Core.Tests/ContextTests.fs b/src/Fantomas.Core.Tests/ContextTests.fs index b1e15f07ae..a9c86c1b84 100644 --- a/src/Fantomas.Core.Tests/ContextTests.fs +++ b/src/Fantomas.Core.Tests/ContextTests.fs @@ -4,7 +4,6 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Context open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig open Fantomas.Core let private dump = dump false diff --git a/src/Fantomas.Core.Tests/ControlStructureTests.fs b/src/Fantomas.Core.Tests/ControlStructureTests.fs index 6f2cd2ff05..8b4556fe47 100644 --- a/src/Fantomas.Core.Tests/ControlStructureTests.fs +++ b/src/Fantomas.Core.Tests/ControlStructureTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.ControlStructureTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``if/then/else block`` () = diff --git a/src/Fantomas.Core.Tests/DallasTests.fs b/src/Fantomas.Core.Tests/DallasTests.fs index ed5e27e7a7..039a54707c 100644 --- a/src/Fantomas.Core.Tests/DallasTests.fs +++ b/src/Fantomas.Core.Tests/DallasTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``proof of concept`` () = diff --git a/src/Fantomas.Core.Tests/DotGetTests.fs b/src/Fantomas.Core.Tests/DotGetTests.fs index 4b7545d2d5..227c2eb507 100644 --- a/src/Fantomas.Core.Tests/DotGetTests.fs +++ b/src/Fantomas.Core.Tests/DotGetTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.DotGetTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``a TypeApp inside a DotGet should stay on the same line, 994`` () = diff --git a/src/Fantomas.Core.Tests/DotIndexedGetTests.fs b/src/Fantomas.Core.Tests/DotIndexedGetTests.fs index d4a61345b6..67375ac7a2 100644 --- a/src/Fantomas.Core.Tests/DotIndexedGetTests.fs +++ b/src/Fantomas.Core.Tests/DotIndexedGetTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.DotIndexedGetTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``multiline function application inside DotIndexedGet`` () = diff --git a/src/Fantomas.Core.Tests/FormattingSelectionOnlyTests.fs b/src/Fantomas.Core.Tests/FormattingSelectionOnlyTests.fs index 2144cd579d..17ec4e6cf0 100644 --- a/src/Fantomas.Core.Tests/FormattingSelectionOnlyTests.fs +++ b/src/Fantomas.Core.Tests/FormattingSelectionOnlyTests.fs @@ -6,7 +6,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -let private config = FormatConfig.FormatConfig.Default +let private config = FormatConfig.Default let private formatSelectionOnly isFsiFile selection (source: string) config = let formattedSelection, _ = diff --git a/src/Fantomas.Core.Tests/InterpolatedStringTests.fs b/src/Fantomas.Core.Tests/InterpolatedStringTests.fs index 468e4fcef2..c5f333c88b 100644 --- a/src/Fantomas.Core.Tests/InterpolatedStringTests.fs +++ b/src/Fantomas.Core.Tests/InterpolatedStringTests.fs @@ -1,6 +1,5 @@ module Fantomas.Core.Tests.InterpolatedStringTests -open FSharp.Compiler.Text open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper diff --git a/src/Fantomas.Core.Tests/KeepIndentInBranchTests.fs b/src/Fantomas.Core.Tests/KeepIndentInBranchTests.fs index e16bbedd44..a1234ba95d 100644 --- a/src/Fantomas.Core.Tests/KeepIndentInBranchTests.fs +++ b/src/Fantomas.Core.Tests/KeepIndentInBranchTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/KeepMaxEmptyLinesTests.fs b/src/Fantomas.Core.Tests/KeepMaxEmptyLinesTests.fs index 7bbf472736..22aa8e2184 100644 --- a/src/Fantomas.Core.Tests/KeepMaxEmptyLinesTests.fs +++ b/src/Fantomas.Core.Tests/KeepMaxEmptyLinesTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let checkFormat config source expected = formatSourceString false source config diff --git a/src/Fantomas.Core.Tests/LambdaTests.fs b/src/Fantomas.Core.Tests/LambdaTests.fs index 2b667a0ce7..96d2ee5ac2 100644 --- a/src/Fantomas.Core.Tests/LambdaTests.fs +++ b/src/Fantomas.Core.Tests/LambdaTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.LambdaTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``keep comment after arrow`` () = diff --git a/src/Fantomas.Core.Tests/LetBindingTests.fs b/src/Fantomas.Core.Tests/LetBindingTests.fs index eb2813c9b3..cf7262cabb 100644 --- a/src/Fantomas.Core.Tests/LetBindingTests.fs +++ b/src/Fantomas.Core.Tests/LetBindingTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.LetBindingTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``let in should be preserved`` () = diff --git a/src/Fantomas.Core.Tests/ListTests.fs b/src/Fantomas.Core.Tests/ListTests.fs index 7b7c4bb2b9..73d21d804b 100644 --- a/src/Fantomas.Core.Tests/ListTests.fs +++ b/src/Fantomas.Core.Tests/ListTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.ListTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``array indices`` () = diff --git a/src/Fantomas.Core.Tests/MultiLineLambdaClosingNewlineTests.fs b/src/Fantomas.Core.Tests/MultiLineLambdaClosingNewlineTests.fs index 99d23671d1..7e236f9f6d 100644 --- a/src/Fantomas.Core.Tests/MultiLineLambdaClosingNewlineTests.fs +++ b/src/Fantomas.Core.Tests/MultiLineLambdaClosingNewlineTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.MultiLineLambdaClosingNewlineTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let defaultConfig = config diff --git a/src/Fantomas.Core.Tests/MultilineBlockBracketsOnSameColumnArrayOrListTests.fs b/src/Fantomas.Core.Tests/MultilineBlockBracketsOnSameColumnArrayOrListTests.fs index 64bc6f0bc3..c5466a5f65 100644 --- a/src/Fantomas.Core.Tests/MultilineBlockBracketsOnSameColumnArrayOrListTests.fs +++ b/src/Fantomas.Core.Tests/MultilineBlockBracketsOnSameColumnArrayOrListTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.MultilineBlockBracketsOnSameColumnArrayOrListTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/MultilineBlockBracketsOnSameColumnRecordTests.fs b/src/Fantomas.Core.Tests/MultilineBlockBracketsOnSameColumnRecordTests.fs index 8d89f76448..b05ceaf2eb 100644 --- a/src/Fantomas.Core.Tests/MultilineBlockBracketsOnSameColumnRecordTests.fs +++ b/src/Fantomas.Core.Tests/MultilineBlockBracketsOnSameColumnRecordTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.MultilineBlockBracketsOnSameColumnRecordTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/NumberOfItemsListOrArrayTests.fs b/src/Fantomas.Core.Tests/NumberOfItemsListOrArrayTests.fs index 628abb822e..44a00d904e 100644 --- a/src/Fantomas.Core.Tests/NumberOfItemsListOrArrayTests.fs +++ b/src/Fantomas.Core.Tests/NumberOfItemsListOrArrayTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.NumberOfItemsListOrArrayTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``number of items sized lists are formatted properly`` () = diff --git a/src/Fantomas.Core.Tests/NumberOfItemsRecordTests.fs b/src/Fantomas.Core.Tests/NumberOfItemsRecordTests.fs index b882e1f54c..730d6e4135 100644 --- a/src/Fantomas.Core.Tests/NumberOfItemsRecordTests.fs +++ b/src/Fantomas.Core.Tests/NumberOfItemsRecordTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.NumberOfItemsRecordTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/OpenTypeTests.fs b/src/Fantomas.Core.Tests/OpenTypeTests.fs index c530c0f6fa..073d08fab4 100644 --- a/src/Fantomas.Core.Tests/OpenTypeTests.fs +++ b/src/Fantomas.Core.Tests/OpenTypeTests.fs @@ -1,6 +1,5 @@ module Fantomas.Core.Tests.OpenTypeTests -open Fantomas open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper diff --git a/src/Fantomas.Core.Tests/OperatorTests.fs b/src/Fantomas.Core.Tests/OperatorTests.fs index a22ab7011d..c2614a41c6 100644 --- a/src/Fantomas.Core.Tests/OperatorTests.fs +++ b/src/Fantomas.Core.Tests/OperatorTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.OperatorTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``should format prefix operators`` () = diff --git a/src/Fantomas.Core.Tests/RecordTests.fs b/src/Fantomas.Core.Tests/RecordTests.fs index 675fcbf368..583bb69c93 100644 --- a/src/Fantomas.Core.Tests/RecordTests.fs +++ b/src/Fantomas.Core.Tests/RecordTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.RecordTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``record declaration`` () = diff --git a/src/Fantomas.Core.Tests/SignatureTests.fs b/src/Fantomas.Core.Tests/SignatureTests.fs index fa66d252ba..e182ba1829 100644 --- a/src/Fantomas.Core.Tests/SignatureTests.fs +++ b/src/Fantomas.Core.Tests/SignatureTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.SignatureTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core // the current behavior results in a compile error since "(string * string) list" is converted to "string * string list" [] diff --git a/src/Fantomas.Core.Tests/SpaceBeforeClassConstructorTests.fs b/src/Fantomas.Core.Tests/SpaceBeforeClassConstructorTests.fs index 1c744fec13..0b6e608be1 100644 --- a/src/Fantomas.Core.Tests/SpaceBeforeClassConstructorTests.fs +++ b/src/Fantomas.Core.Tests/SpaceBeforeClassConstructorTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.SpaceBeforeClassConstructorTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let spaceBeforeConfig = { config with diff --git a/src/Fantomas.Core.Tests/Stroustrup/DotIndexedSetExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/DotIndexedSetExpressionTests.fs index 88d69a4e49..66d33f056a 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/DotIndexedSetExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/DotIndexedSetExpressionTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/Stroustrup/DotSetExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/DotSetExpressionTests.fs index e345eb9a6e..7e13318430 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/DotSetExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/DotSetExpressionTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/Stroustrup/ElmishTests.fs b/src/Fantomas.Core.Tests/Stroustrup/ElmishTests.fs index 22d60553c3..9272a1064e 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/ElmishTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/ElmishTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.ElmishTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with @@ -1355,7 +1355,7 @@ let Dashboard () = ] """ { config with - RecordMultilineFormatter = Fantomas.Core.FormatConfig.MultilineFormatterType.NumberOfItems + RecordMultilineFormatter = MultilineFormatterType.NumberOfItems MaxArrayOrListWidth = 20 // MaxElmishWidth = 10 MultiLineLambdaClosingNewline = true } diff --git a/src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationDualListTests.fs b/src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationDualListTests.fs index 5bc637a864..b2fc44e629 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationDualListTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationDualListTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationSingleListTests.fs b/src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationSingleListTests.fs index a100c73de5..4da71aaef8 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationSingleListTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationSingleListTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/Stroustrup/KeepIndentInBranchExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/KeepIndentInBranchExpressionTests.fs index 986252a46e..e1bd30ccc1 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/KeepIndentInBranchExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/KeepIndentInBranchExpressionTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core // ExperimentalKeepIndentInBranch has precedence over ExperimentalStroustrupStyle diff --git a/src/Fantomas.Core.Tests/Stroustrup/LambdaExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/LambdaExpressionTests.fs index 74b944bd77..ab6914fd5b 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/LambdaExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/LambdaExpressionTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/Stroustrup/LetOrUseBangExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/LetOrUseBangExpressionTests.fs index e04c7b04ac..f095473fab 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/LetOrUseBangExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/LetOrUseBangExpressionTests.fs @@ -2,7 +2,7 @@ open NUnit.Framework open FsUnit -open Fantomas.Core.FormatConfig +open Fantomas.Core open Fantomas.Core.Tests.TestHelper let config = diff --git a/src/Fantomas.Core.Tests/Stroustrup/LongIdentSetExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/LongIdentSetExpressionTests.fs index f230f6db86..208456d3a0 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/LongIdentSetExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/LongIdentSetExpressionTests.fs @@ -2,7 +2,7 @@ open NUnit.Framework open FsUnit -open Fantomas.Core.FormatConfig +open Fantomas.Core open Fantomas.Core.Tests.TestHelper let config = diff --git a/src/Fantomas.Core.Tests/Stroustrup/MultiLineLambdaClosingNewlineExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/MultiLineLambdaClosingNewlineExpressionTests.fs index 8540d0ca21..4705fe4e85 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/MultiLineLambdaClosingNewlineExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/MultiLineLambdaClosingNewlineExpressionTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/Stroustrup/NamedArgumentExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/NamedArgumentExpressionTests.fs index 716a642543..16a88577fa 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/NamedArgumentExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/NamedArgumentExpressionTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/Stroustrup/SetExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SetExpressionTests.fs index 6ad063f916..9aa5d0b4cb 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/SetExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SetExpressionTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionExpressionTests.fs index f48d866057..1208f15155 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionExpressionTests.fs @@ -2,7 +2,7 @@ open NUnit.Framework open FsUnit -open Fantomas.Core.FormatConfig +open Fantomas.Core open Fantomas.Core.Tests.TestHelper let config = diff --git a/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionLongPatternExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionLongPatternExpressionTests.fs index b47c444e4a..42565d873a 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionLongPatternExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionLongPatternExpressionTests.fs @@ -2,7 +2,7 @@ open NUnit.Framework open FsUnit -open Fantomas.Core.FormatConfig +open Fantomas.Core open Fantomas.Core.Tests.TestHelper let config = diff --git a/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionWithReturnTypeExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionWithReturnTypeExpressionTests.fs index 9b2f224d53..d164bf3648 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionWithReturnTypeExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionWithReturnTypeExpressionTests.fs @@ -2,7 +2,7 @@ open NUnit.Framework open FsUnit -open Fantomas.Core.FormatConfig +open Fantomas.Core open Fantomas.Core.Tests.TestHelper let config = diff --git a/src/Fantomas.Core.Tests/Stroustrup/SynBindingValueExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynBindingValueExpressionTests.fs index 84e4040459..e368e62ecb 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/SynBindingValueExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynBindingValueExpressionTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/Stroustrup/SynExprAndBangExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynExprAndBangExpressionTests.fs index b330cf93b5..bd5b52a0a9 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/SynExprAndBangExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynExprAndBangExpressionTests.fs @@ -2,7 +2,7 @@ open NUnit.Framework open FsUnit -open Fantomas.Core.FormatConfig +open Fantomas.Core open Fantomas.Core.Tests.TestHelper let config = diff --git a/src/Fantomas.Core.Tests/Stroustrup/SynMatchClauseExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynMatchClauseExpressionTests.fs index 153490a445..6502c475c8 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/SynMatchClauseExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynMatchClauseExpressionTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSigReprSimpleTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSigReprSimpleTests.fs index 12058bbaa9..2f4698f006 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSigReprSimpleTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSigReprSimpleTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSimpleReprRecordTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSimpleReprRecordTests.fs index 11e531eab4..8c86841863 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSimpleReprRecordTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSimpleReprRecordTests.fs @@ -3,7 +3,7 @@ open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core let config = { config with diff --git a/src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnBangExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnBangExpressionTests.fs index e23c3b8df8..47473ca144 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnBangExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnBangExpressionTests.fs @@ -2,7 +2,7 @@ open NUnit.Framework open FsUnit -open Fantomas.Core.FormatConfig +open Fantomas.Core open Fantomas.Core.Tests.TestHelper let config = diff --git a/src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnExpressionTests.fs index 6828057ab7..8c2b46b72b 100644 --- a/src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnExpressionTests.fs @@ -2,7 +2,7 @@ open NUnit.Framework open FsUnit -open Fantomas.Core.FormatConfig +open Fantomas.Core open Fantomas.Core.Tests.TestHelper let config = diff --git a/src/Fantomas.Core.Tests/TestHelpers.fs b/src/Fantomas.Core.Tests/TestHelpers.fs index cc35bd77df..cb1eeedd2d 100644 --- a/src/Fantomas.Core.Tests/TestHelpers.fs +++ b/src/Fantomas.Core.Tests/TestHelpers.fs @@ -1,11 +1,10 @@ module Fantomas.Core.Tests.TestHelper open System +open Fantomas.Core open Fantomas.Core.SyntaxOak open NUnit.Framework open FsUnit -open Fantomas.Core.FormatConfig -open Fantomas.Core [] do () diff --git a/src/Fantomas.Core.Tests/TypeDeclarationTests.fs b/src/Fantomas.Core.Tests/TypeDeclarationTests.fs index cd31210c13..92c8155473 100644 --- a/src/Fantomas.Core.Tests/TypeDeclarationTests.fs +++ b/src/Fantomas.Core.Tests/TypeDeclarationTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.TypeDeclarationTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``exception declarations`` () = diff --git a/src/Fantomas.Core.Tests/TypeProviderTests.fs b/src/Fantomas.Core.Tests/TypeProviderTests.fs index 5c16cee979..7735df89b4 100644 --- a/src/Fantomas.Core.Tests/TypeProviderTests.fs +++ b/src/Fantomas.Core.Tests/TypeProviderTests.fs @@ -49,7 +49,7 @@ type Graphml = XmlProvider] let ``should throw FormatException on unparsed input`` () = - Assert.Throws(fun () -> + Assert.Throws(fun () -> formatSourceString false """ diff --git a/src/Fantomas.Core.Tests/UnionTests.fs b/src/Fantomas.Core.Tests/UnionTests.fs index dd0e7aa303..c3d2c99be5 100644 --- a/src/Fantomas.Core.Tests/UnionTests.fs +++ b/src/Fantomas.Core.Tests/UnionTests.fs @@ -3,7 +3,7 @@ module Fantomas.Core.Tests.UnionsTests open NUnit.Framework open FsUnit open Fantomas.Core.Tests.TestHelper -open Fantomas.Core.FormatConfig +open Fantomas.Core [] let ``enums declaration`` () = diff --git a/src/Fantomas.Core/CodeFormatter.fs b/src/Fantomas.Core/CodeFormatter.fs index 83573c0a31..0ac2bbacbc 100644 --- a/src/Fantomas.Core/CodeFormatter.fs +++ b/src/Fantomas.Core/CodeFormatter.fs @@ -10,18 +10,18 @@ type CodeFormatter = static member FormatASTAsync(ast: ParsedInput, ?source, ?config) : Async = let sourceText = Option.map CodeFormatterImpl.getSourceText source - let config = Option.defaultValue FormatConfig.FormatConfig.Default config + let config = Option.defaultValue FormatConfig.Default config CodeFormatterImpl.formatAST ast sourceText config |> async.Return static member FormatDocumentAsync(isSignature, source, config) = - let config = Option.defaultValue FormatConfig.FormatConfig.Default config + let config = Option.defaultValue FormatConfig.Default config CodeFormatterImpl.getSourceText source |> CodeFormatterImpl.formatDocument config isSignature static member FormatSelectionAsync(isSignature, source, selection, config) = - let config = Option.defaultValue FormatConfig.FormatConfig.Default config + let config = Option.defaultValue FormatConfig.Default config CodeFormatterImpl.getSourceText source |> Selection.formatSelection config isSignature selection diff --git a/src/Fantomas.Core/CodeFormatter.fsi b/src/Fantomas.Core/CodeFormatter.fsi index dc8e37e84a..fe69ba9e92 100644 --- a/src/Fantomas.Core/CodeFormatter.fsi +++ b/src/Fantomas.Core/CodeFormatter.fsi @@ -1,6 +1,5 @@ namespace Fantomas.Core -open Fantomas.Core.FormatConfig open FSharp.Compiler.Text open FSharp.Compiler.Syntax diff --git a/src/Fantomas.Core/CodeFormatterImpl.fs b/src/Fantomas.Core/CodeFormatterImpl.fs index 15bfd0ed58..46f3c2feb4 100644 --- a/src/Fantomas.Core/CodeFormatterImpl.fs +++ b/src/Fantomas.Core/CodeFormatterImpl.fs @@ -4,8 +4,6 @@ module internal Fantomas.Core.CodeFormatterImpl open FSharp.Compiler.Diagnostics open FSharp.Compiler.Syntax open FSharp.Compiler.Text -open Fantomas.Core -open Fantomas.Core.FormatConfig open Fantomas.Core.SyntaxOak let getSourceText (source: string) : ISourceText = source.TrimEnd() |> SourceText.ofString diff --git a/src/Fantomas.Core/CodeFormatterImpl.fsi b/src/Fantomas.Core/CodeFormatterImpl.fsi index bbf9ea6783..1e9e815146 100644 --- a/src/Fantomas.Core/CodeFormatterImpl.fsi +++ b/src/Fantomas.Core/CodeFormatterImpl.fsi @@ -3,7 +3,6 @@ module internal Fantomas.Core.CodeFormatterImpl open FSharp.Compiler.Syntax open FSharp.Compiler.Text -open Fantomas.Core.FormatConfig open Fantomas.Core.SyntaxOak val getSourceText: source: string -> ISourceText diff --git a/src/Fantomas.Core/CodePrinter.fs b/src/Fantomas.Core/CodePrinter.fs index 5ddb4f4b56..dbf17ffaa2 100644 --- a/src/Fantomas.Core/CodePrinter.fs +++ b/src/Fantomas.Core/CodePrinter.fs @@ -3,7 +3,6 @@ module internal rec Fantomas.Core.CodePrinter open System open Fantomas.Core.Context open Fantomas.Core.SyntaxOak -open Fantomas.Core.FormatConfig open Microsoft.FSharp.Core.CompilerServices let noBreakInfixOps = set [| "="; ">"; "<"; "%" |] diff --git a/src/Fantomas.Core/Context.fs b/src/Fantomas.Core/Context.fs index 8ddb9a2231..1908074979 100644 --- a/src/Fantomas.Core/Context.fs +++ b/src/Fantomas.Core/Context.fs @@ -2,7 +2,6 @@ module internal Fantomas.Core.Context open System open Fantomas.Core -open Fantomas.Core.FormatConfig open Fantomas.Core.SyntaxOak type WriterEvent = diff --git a/src/Fantomas.Core/Context.fsi b/src/Fantomas.Core/Context.fsi index cf11bd354d..787b88bdba 100644 --- a/src/Fantomas.Core/Context.fsi +++ b/src/Fantomas.Core/Context.fsi @@ -1,7 +1,5 @@ module internal Fantomas.Core.Context -open Fantomas.Core -open Fantomas.Core.FormatConfig open Fantomas.Core.SyntaxOak type WriterEvent = diff --git a/src/Fantomas.Core/FormatConfig.fs b/src/Fantomas.Core/FormatConfig.fs index e46e4b57d5..115e0b4dea 100644 --- a/src/Fantomas.Core/FormatConfig.fs +++ b/src/Fantomas.Core/FormatConfig.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.FormatConfig +namespace Fantomas.Core open System open System.ComponentModel diff --git a/src/Fantomas.Core/Selection.fs b/src/Fantomas.Core/Selection.fs index d6cf69ff8c..842d36397b 100644 --- a/src/Fantomas.Core/Selection.fs +++ b/src/Fantomas.Core/Selection.fs @@ -1,8 +1,6 @@ module internal Fantomas.Core.Selection open FSharp.Compiler.Text -open Fantomas.Core -open Fantomas.Core.FormatConfig open Fantomas.Core.SyntaxOak open Fantomas.Core.ISourceTextExtensions diff --git a/src/Fantomas.Core/Selection.fsi b/src/Fantomas.Core/Selection.fsi index 042e47619a..dde98cd52f 100644 --- a/src/Fantomas.Core/Selection.fsi +++ b/src/Fantomas.Core/Selection.fsi @@ -1,7 +1,6 @@ module internal Fantomas.Core.Selection open FSharp.Compiler.Text -open Fantomas.Core.FormatConfig val formatSelection: config: FormatConfig -> isSignature: bool -> selection: range -> sourceText: ISourceText -> Async diff --git a/src/Fantomas.Core/Trivia.fs b/src/Fantomas.Core/Trivia.fs index 7306a413ac..5a2208a37f 100644 --- a/src/Fantomas.Core/Trivia.fs +++ b/src/Fantomas.Core/Trivia.fs @@ -3,7 +3,6 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.Text -open Fantomas.Core.FormatConfig open Fantomas.Core.ISourceTextExtensions open Fantomas.Core.SyntaxOak diff --git a/src/Fantomas.Core/Trivia.fsi b/src/Fantomas.Core/Trivia.fsi index a362199b48..a1ec8c32f6 100644 --- a/src/Fantomas.Core/Trivia.fsi +++ b/src/Fantomas.Core/Trivia.fsi @@ -2,7 +2,6 @@ module internal Fantomas.Core.Trivia open FSharp.Compiler.Syntax open FSharp.Compiler.Text -open Fantomas.Core.FormatConfig open Fantomas.Core.SyntaxOak val findNodeWhereRangeFitsIn: root: Node -> range: range -> Node option diff --git a/src/Fantomas.Tests/EditorConfigurationTests.fs b/src/Fantomas.Tests/EditorConfigurationTests.fs index eda9023e31..45158793b0 100644 --- a/src/Fantomas.Tests/EditorConfigurationTests.fs +++ b/src/Fantomas.Tests/EditorConfigurationTests.fs @@ -2,7 +2,6 @@ module Fantomas.Tests.EditorConfigurationTests open System open Fantomas.Core -open Fantomas.Core.FormatConfig open Fantomas open NUnit.Framework open System.IO @@ -14,7 +13,7 @@ let tempName () = Guid.NewGuid().ToString("N") type ConfigurationFile internal ( - config: FormatConfig.FormatConfig, + config: FormatConfig, rootFolderName: string, ?editorConfigHeader: string, ?subFolder: string, diff --git a/src/Fantomas.Tests/Integration/ConfigTests.fs b/src/Fantomas.Tests/Integration/ConfigTests.fs index 27fcaa9933..72c6e1544c 100644 --- a/src/Fantomas.Tests/Integration/ConfigTests.fs +++ b/src/Fantomas.Tests/Integration/ConfigTests.fs @@ -61,8 +61,7 @@ let valid_eol_settings = [ "lf"; "crlf" ] [] let ``uses end_of_line setting to write user newlines`` setting = - let newline = - (FormatConfig.EndOfLineStyle.OfConfigString setting).Value.NewLineString + let newline = (EndOfLineStyle.OfConfigString setting).Value.NewLineString let sampleCode nln = sprintf "let a = 9%s%slet b = 7%s" nln nln nln @@ -95,8 +94,7 @@ let ``end_of_line should be respected for ifdef`` () = use configFixture = new ConfigurationFile( - sprintf - """ + """ [*.fs] end_of_line = lf """ diff --git a/src/Fantomas.Tests/Integration/DaemonTests.fs b/src/Fantomas.Tests/Integration/DaemonTests.fs index 74730dd6ca..95544e8e88 100644 --- a/src/Fantomas.Tests/Integration/DaemonTests.fs +++ b/src/Fantomas.Tests/Integration/DaemonTests.fs @@ -42,7 +42,7 @@ let ``config request`` () = async { let! config = client.InvokeAsync(Methods.Configuration) |> Async.AwaitTask - FormatConfig.FormatConfig.Default + FormatConfig.Default |> Fantomas.EditorConfig.configToEditorConfig |> fun s -> s.Split('\n') |> Seq.map (fun line -> line.Split('=').[0]) diff --git a/src/Fantomas/Daemon.fs b/src/Fantomas/Daemon.fs index 3e0c43635c..9aa45fefb6 100644 --- a/src/Fantomas/Daemon.fs +++ b/src/Fantomas/Daemon.fs @@ -12,7 +12,6 @@ open FSharp.Compiler.Text open Fantomas.Client.Contracts open Fantomas.Client.LSPFantomasServiceTypes open Fantomas.Core -open Fantomas.Core.FormatConfig open Fantomas.EditorConfig type FantomasDaemon(sender: Stream, reader: Stream) as this = @@ -109,7 +108,7 @@ type FantomasDaemon(sender: Stream, reader: Stream) as this = [] member _.Configuration() : string = let settings = - Reflection.getRecordFields FormatConfig.FormatConfig.Default + Reflection.getRecordFields FormatConfig.Default |> Array.toList |> List.choose (fun (recordField, defaultValue) -> let optionalField key value = diff --git a/src/Fantomas/EditorConfig.fs b/src/Fantomas/EditorConfig.fs index 39e6f4826c..8f5e4d6908 100644 --- a/src/Fantomas/EditorConfig.fs +++ b/src/Fantomas/EditorConfig.fs @@ -2,7 +2,7 @@ module Fantomas.EditorConfig open System.Collections.Generic open System.ComponentModel -open Fantomas.Core.FormatConfig +open Fantomas.Core module Reflection = open System diff --git a/src/Fantomas/EditorConfig.fsi b/src/Fantomas/EditorConfig.fsi index 849030ad42..814eaa0597 100644 --- a/src/Fantomas/EditorConfig.fsi +++ b/src/Fantomas/EditorConfig.fsi @@ -1,5 +1,7 @@ module Fantomas.EditorConfig +open Fantomas.Core + module Reflection = type FSharpRecordField = @@ -15,12 +17,12 @@ val supportedProperties: string list val toEditorConfigName: value: seq -> string val parseOptionsFromEditorConfig: - fallbackConfig: Core.FormatConfig.FormatConfig -> + fallbackConfig: FormatConfig -> editorConfigProperties: System.Collections.Generic.IReadOnlyDictionary -> - Core.FormatConfig.FormatConfig + FormatConfig -val configToEditorConfig: config: Core.FormatConfig.FormatConfig -> string +val configToEditorConfig: config: FormatConfig -> string -val tryReadConfiguration: fsharpFile: string -> Core.FormatConfig.FormatConfig option +val tryReadConfiguration: fsharpFile: string -> FormatConfig option -val readConfiguration: fsharpFile: string -> Core.FormatConfig.FormatConfig +val readConfiguration: fsharpFile: string -> FormatConfig diff --git a/src/Fantomas/Format.fs b/src/Fantomas/Format.fs index ee7e276eed..e13b63de28 100644 --- a/src/Fantomas/Format.fs +++ b/src/Fantomas/Format.fs @@ -3,7 +3,6 @@ module Fantomas.Format open System open System.IO open Fantomas.Core -open Fantomas.Core.FormatConfig exception CodeFormatException of (string * Option) array with override x.ToString() = diff --git a/src/Fantomas/Format.fsi b/src/Fantomas/Format.fsi index 9d5aa64ca0..188be113d3 100644 --- a/src/Fantomas/Format.fsi +++ b/src/Fantomas/Format.fsi @@ -1,6 +1,7 @@ module Fantomas.Format open System +open Fantomas.Core exception CodeFormatException of (string * Option) array @@ -11,7 +12,7 @@ type FormatResult = | Error of filename: string * formattingError: Exception | IgnoredFile of filename: string -val formatContentAsync: (Core.FormatConfig.FormatConfig -> string -> string -> Async) +val formatContentAsync: (FormatConfig -> string -> string -> Async) val formatFileAsync: (string -> Async)