From 671a50064bc3a576292acb982037be29096d8ba7 Mon Sep 17 00:00:00 2001 From: Alex Berezhnykh Date: Tue, 4 May 2021 13:23:53 +0300 Subject: [PATCH] add yet another FantomasConfig property --- .../FSharp.ExternalFormatter.Host/src/FantomasCodeFormatter.cs | 2 +- .../FSharp.Psi.Features/src/Formatter/CodeFormatterProvider.fs | 3 ++- .../src/kotlin/model/RdFSharpExternalFormatterModel.kt | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ReSharper.FSharp/src/FSharp.ExternalFormatter.Host/src/FantomasCodeFormatter.cs b/ReSharper.FSharp/src/FSharp.ExternalFormatter.Host/src/FantomasCodeFormatter.cs index 92f0cb55f6..150f1c5210 100644 --- a/ReSharper.FSharp/src/FSharp.ExternalFormatter.Host/src/FantomasCodeFormatter.cs +++ b/ReSharper.FSharp/src/FSharp.ExternalFormatter.Host/src/FantomasCodeFormatter.cs @@ -37,7 +37,7 @@ private static FSharpParsingOptions Convert(RdFcsParsingOptions options) => options.LightSyntax, false, options.IsExe); private FormatConfig.FormatConfig Convert(RdFantomasFormatConfig config) => - new FormatConfig.FormatConfig(config.IndentSize, config.MaxLineLength, myDefaultFormatConfig.SemicolonAtEndOfLine, + new FormatConfig.FormatConfig(config.IndentSize, config.MaxLineLength, config.SemicolonAtEndOfLine, config.SpaceBeforeParameter, config.SpaceBeforeLowercaseInvocation, config.SpaceBeforeUppercaseInvocation, config.SpaceBeforeClassConstructor, config.SpaceBeforeMember, config.SpaceBeforeColon, config.SpaceAfterComma, config.SpaceBeforeSemicolon, config.SpaceAfterSemicolon, config.IndentOnTryWith, config.SpaceAroundDelimiter, diff --git a/ReSharper.FSharp/src/FSharp.Psi.Features/src/Formatter/CodeFormatterProvider.fs b/ReSharper.FSharp/src/FSharp.Psi.Features/src/Formatter/CodeFormatterProvider.fs index c1f8bc9add..75e7e9eac5 100644 --- a/ReSharper.FSharp/src/FSharp.Psi.Features/src/Formatter/CodeFormatterProvider.fs +++ b/ReSharper.FSharp/src/FSharp.Psi.Features/src/Formatter/CodeFormatterProvider.fs @@ -39,7 +39,8 @@ type CodeFormatterProvider(solution: ISolution, externalFormatterFactory: Extern settings.MaxValueBindingWidth, settings.MaxFunctionBindingWidth, settings.MultilineBlockBracketsOnSameColumn, settings.NewlineBetweenTypeDefinitionAndMembers, settings.KeepIfThenInSameLine, settings.MaxElmishWidth, settings.SingleArgumentWebMode, - settings.AlignFunctionSignatureToIndentation, settings.AlternativeLongMemberDefinitions) + settings.AlignFunctionSignatureToIndentation, settings.AlternativeLongMemberDefinitions, + settings.SemicolonAtEndOfLine) let convertParsingOptions (options: FSharpParsingOptions) = let lightSyntax = diff --git a/rider-fsharp/protocol/src/kotlin/model/RdFSharpExternalFormatterModel.kt b/rider-fsharp/protocol/src/kotlin/model/RdFSharpExternalFormatterModel.kt index 48ad757c5a..4ffc30c6cf 100644 --- a/rider-fsharp/protocol/src/kotlin/model/RdFSharpExternalFormatterModel.kt +++ b/rider-fsharp/protocol/src/kotlin/model/RdFSharpExternalFormatterModel.kt @@ -51,6 +51,7 @@ object RdFSharpExternalFormatterModel : Root() { field("singleArgumentWebMode", bool) field("alignFunctionSignatureToIndentation", bool) field("alternativeLongMemberDefinitions", bool) + field("semicolonAtEndOfLine", bool) } private val rdFormatArgs = basestruct {