From c5a11a3b6fbc7174cd6f4dd117a3d7d54e1ef009 Mon Sep 17 00:00:00 2001 From: dawe Date: Wed, 28 Feb 2024 11:25:43 +0100 Subject: [PATCH 1/4] - update FCS to 2e95cbcc2cdf0317df6d5724cd62b15da4cea02b - add tests for extended interpolated strings --- CHANGELOG.md | 4 +++ Directory.Build.props | 2 +- Directory.Packages.props | 1 + build.fsx | 4 +++ src/Fantomas.Benchmarks/packages.lock.json | 12 ++++---- src/Fantomas.Client.Tests/packages.lock.json | 11 ++++---- src/Fantomas.Client/packages.lock.json | 17 +++++------ .../InterpolatedStringTests.fs | 28 +++++++++++++++++++ src/Fantomas.Core.Tests/packages.lock.json | 7 +++++ src/Fantomas.Core/packages.lock.json | 11 ++++++++ src/Fantomas.FCS/Fantomas.FCS.fsproj | 13 +++++++++ src/Fantomas.FCS/packages.lock.json | 10 +++++++ src/Fantomas.Tests/packages.lock.json | 12 ++++---- src/Fantomas/packages.lock.json | 15 ++++++---- 14 files changed, 118 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 475c6f49a5..d5566ed701 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,13 @@ ## [Unreleased] +### Changed +* Update FCS to 'fix wrong range start of INTERP_STRING_END', commit 2e95cbcc2cdf0317df6d5724cd62b15da4cea02b [#3052](https://github.com/fsprojects/fantomas/pull/3052) + ### Fixed * Equals sign should only be on same line if last tuple is multiline. [#3040](https://github.com/fsprojects/fantomas/issues/3040) * Return type should go on next line. [#3041](https://github.com/fsprojects/fantomas/issues/3041) +* Fantomas does not support extended interpolated strings [#3012](https://github.com/fsprojects/fantomas/issues/3012) ## 6.3.0-alpha-007 - 2024-01-27 diff --git a/Directory.Build.props b/Directory.Build.props index d2c654e577..9973fd35de 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -46,7 +46,7 @@ Some common use cases include: - e2496896c128ccfde33c92f45bbe0d2aa738873a + 2e95cbcc2cdf0317df6d5724cd62b15da4cea02b diff --git a/Directory.Packages.props b/Directory.Packages.props index 53917452bd..f88e424d54 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,6 +4,7 @@ + diff --git a/build.fsx b/build.fsx index a78c069d06..33ebfaa07e 100644 --- a/build.fsx +++ b/build.fsx @@ -237,6 +237,8 @@ pipeline "Init" { "src/Compiler/Utilities/ResizeArray.fs" "src/Compiler/Utilities/HashMultiMap.fsi" "src/Compiler/Utilities/HashMultiMap.fs" + "src/Compiler/Utilities/ReadOnlySpan.fsi" + "src/Compiler/Utilities/ReadOnlySpan.fs" "src/Compiler/Utilities/TaggedCollections.fsi" "src/Compiler/Utilities/TaggedCollections.fs" "src/Compiler/Utilities/illib.fsi" @@ -267,6 +269,8 @@ pipeline "Init" { "src/Compiler/Facilities/DiagnosticOptions.fs" "src/Compiler/Facilities/DiagnosticsLogger.fsi" "src/Compiler/Facilities/DiagnosticsLogger.fs" + "src/Compiler/Facilities/Hashing.fsi" + "src/Compiler/Facilities/Hashing.fs" "src/Compiler/Facilities/prim-lexing.fsi" "src/Compiler/Facilities/prim-lexing.fs" "src/Compiler/Facilities/prim-parsing.fsi" diff --git a/src/Fantomas.Benchmarks/packages.lock.json b/src/Fantomas.Benchmarks/packages.lock.json index 7be5a6a286..96e74a4341 100644 --- a/src/Fantomas.Benchmarks/packages.lock.json +++ b/src/Fantomas.Benchmarks/packages.lock.json @@ -223,11 +223,6 @@ "resolved": "5.0.0", "contentHash": "JPJArwA1kdj8qDAkY2XGjSWoYnqiM7q/3yRNkt6n28Mnn95MuEGkZXUbPBf7qc3IjwrGY5ttQon7yqHZyQJmOQ==" }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==" - }, "System.Management": { "type": "Transitive", "resolved": "5.0.0", @@ -287,11 +282,18 @@ "type": "Project", "dependencies": { "FSharp.Core": "[6.0.1, )", + "System.Collections.Immutable": "[7.0.0, )", "System.Diagnostics.DiagnosticSource": "[7.0.0, )", "System.Memory": "[4.5.5, )", "System.Runtime": "[4.3.1, )" } }, + "System.Collections.Immutable": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==" + }, "System.Diagnostics.DiagnosticSource": { "type": "CentralTransitive", "requested": "[7.0.0, )", diff --git a/src/Fantomas.Client.Tests/packages.lock.json b/src/Fantomas.Client.Tests/packages.lock.json index a2949ff343..84b50fcbce 100644 --- a/src/Fantomas.Client.Tests/packages.lock.json +++ b/src/Fantomas.Client.Tests/packages.lock.json @@ -301,11 +301,6 @@ "System.Threading.Tasks": "4.3.0" } }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==" - }, "System.Diagnostics.Debug": { "type": "Transitive", "resolved": "4.3.0", @@ -798,6 +793,12 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "System.Collections.Immutable": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "5.0.0", + "contentHash": "FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==" + }, "System.Diagnostics.DiagnosticSource": { "type": "CentralTransitive", "requested": "[7.0.0, )", diff --git a/src/Fantomas.Client/packages.lock.json b/src/Fantomas.Client/packages.lock.json index 192d990e54..3cb88eed6c 100644 --- a/src/Fantomas.Client/packages.lock.json +++ b/src/Fantomas.Client/packages.lock.json @@ -356,14 +356,6 @@ "System.Threading.Tasks": "4.3.0" } }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==", - "dependencies": { - "System.Memory": "4.5.4" - } - }, "System.Diagnostics.Debug": { "type": "Transitive", "resolved": "4.3.0", @@ -838,6 +830,15 @@ "System.Runtime.CompilerServices.Unsafe": "4.5.3" } }, + "System.Collections.Immutable": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "5.0.0", + "contentHash": "FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==", + "dependencies": { + "System.Memory": "4.5.4" + } + }, "System.Diagnostics.DiagnosticSource": { "type": "CentralTransitive", "requested": "[7.0.0, )", diff --git a/src/Fantomas.Core.Tests/InterpolatedStringTests.fs b/src/Fantomas.Core.Tests/InterpolatedStringTests.fs index d8914b4acd..a960bb7d14 100644 --- a/src/Fantomas.Core.Tests/InterpolatedStringTests.fs +++ b/src/Fantomas.Core.Tests/InterpolatedStringTests.fs @@ -362,3 +362,31 @@ let ``very long triple-quoted strings do not cause the interpolated string activ $"let value = \"\"\"%s{loremIpsum}\"\"\" " + +[] +let ``don't eat braces, 3012`` () = + formatSourceString + " +$$$\"\"\"{{{5}}}\"\"\" +" + config + |> prepend newline + |> should + equal + " +$$$\"\"\"{{{5}}}\"\"\" +" + +[] +let ``extended interpolated string with several fill expressions`` () = + formatSourceString + " +let x = $$$\"\"\"one {{{1}}} two {{{2}}} three {{{3}}}\"\"\" +" + config + |> prepend newline + |> should + equal + " +let x = $$$\"\"\"one {{{1}}} two {{{2}}} three {{{3}}}\"\"\" +" diff --git a/src/Fantomas.Core.Tests/packages.lock.json b/src/Fantomas.Core.Tests/packages.lock.json index cb072e0469..e7d1cd1394 100644 --- a/src/Fantomas.Core.Tests/packages.lock.json +++ b/src/Fantomas.Core.Tests/packages.lock.json @@ -157,11 +157,18 @@ "type": "Project", "dependencies": { "FSharp.Core": "[6.0.1, )", + "System.Collections.Immutable": "[7.0.0, )", "System.Diagnostics.DiagnosticSource": "[7.0.0, )", "System.Memory": "[4.5.5, )", "System.Runtime": "[4.3.1, )" } }, + "System.Collections.Immutable": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==" + }, "System.Diagnostics.DiagnosticSource": { "type": "CentralTransitive", "requested": "[7.0.0, )", diff --git a/src/Fantomas.Core/packages.lock.json b/src/Fantomas.Core/packages.lock.json index a14accc5e5..a008de8466 100644 --- a/src/Fantomas.Core/packages.lock.json +++ b/src/Fantomas.Core/packages.lock.json @@ -128,11 +128,22 @@ "type": "Project", "dependencies": { "FSharp.Core": "[6.0.1, )", + "System.Collections.Immutable": "[7.0.0, )", "System.Diagnostics.DiagnosticSource": "[7.0.0, )", "System.Memory": "[4.5.5, )", "System.Runtime": "[4.3.1, )" } }, + "System.Collections.Immutable": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, "System.Diagnostics.DiagnosticSource": { "type": "CentralTransitive", "requested": "[7.0.0, )", diff --git a/src/Fantomas.FCS/Fantomas.FCS.fsproj b/src/Fantomas.FCS/Fantomas.FCS.fsproj index 8e014aa67c..7de8cd7585 100644 --- a/src/Fantomas.FCS/Fantomas.FCS.fsproj +++ b/src/Fantomas.FCS/Fantomas.FCS.fsproj @@ -53,6 +53,12 @@ Utilities\HashMultiMap.fs + + Utilities\HashMultiMap.fs + + + Utilities\HashMultiMap.fs + Utilities\TaggedCollections.fsi @@ -143,6 +149,12 @@ Facilities\DiagnosticsLogger.fs + + Facilities\Hashing.fsi + + + Facilities\Hashing.fs + Facilities\prim-lexing.fsi @@ -304,6 +316,7 @@ + diff --git a/src/Fantomas.FCS/packages.lock.json b/src/Fantomas.FCS/packages.lock.json index bfb296d53f..ecd2ba73f6 100644 --- a/src/Fantomas.FCS/packages.lock.json +++ b/src/Fantomas.FCS/packages.lock.json @@ -63,6 +63,16 @@ "Microsoft.NETCore.Platforms": "1.1.0" } }, + "System.Collections.Immutable": { + "type": "Direct", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, "System.Diagnostics.DiagnosticSource": { "type": "Direct", "requested": "[7.0.0, )", diff --git a/src/Fantomas.Tests/packages.lock.json b/src/Fantomas.Tests/packages.lock.json index 8e103a5959..c5a90186e7 100644 --- a/src/Fantomas.Tests/packages.lock.json +++ b/src/Fantomas.Tests/packages.lock.json @@ -331,11 +331,6 @@ "System.Threading.Tasks": "4.3.0" } }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==" - }, "System.Configuration.ConfigurationManager": { "type": "Transitive", "resolved": "4.4.0", @@ -864,6 +859,7 @@ "type": "Project", "dependencies": { "FSharp.Core": "[6.0.1, )", + "System.Collections.Immutable": "[7.0.0, )", "System.Diagnostics.DiagnosticSource": "[7.0.0, )", "System.Memory": "[4.5.5, )", "System.Runtime": "[4.3.1, )" @@ -952,6 +948,12 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "System.Collections.Immutable": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==" + }, "System.Diagnostics.DiagnosticSource": { "type": "CentralTransitive", "requested": "[7.0.0, )", diff --git a/src/Fantomas/packages.lock.json b/src/Fantomas/packages.lock.json index bac3b5af10..f084b40016 100644 --- a/src/Fantomas/packages.lock.json +++ b/src/Fantomas/packages.lock.json @@ -415,11 +415,6 @@ "System.Threading.Tasks": "4.3.0" } }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==" - }, "System.Configuration.ConfigurationManager": { "type": "Transitive", "resolved": "4.4.0", @@ -916,6 +911,7 @@ "type": "Project", "dependencies": { "FSharp.Core": "[6.0.1, )", + "System.Collections.Immutable": "[7.0.0, )", "System.Diagnostics.DiagnosticSource": "[7.0.0, )", "System.Memory": "[4.5.5, )", "System.Runtime": "[4.3.1, )" @@ -927,6 +923,15 @@ "resolved": "2.0.2", "contentHash": "4EQgYdNZ92SyaO7YFk6olVnebF5V+jrHyMUjvPq89tLeMo8NSfgDF+6Zwq/lgh9j/0yfQp9Lkm0ZA0rUATCZFA==" }, + "System.Collections.Immutable": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, "System.Diagnostics.DiagnosticSource": { "type": "CentralTransitive", "requested": "[7.0.0, )", From 798f45acc4bbd667c7cad91ebeafc1ac5a89850e Mon Sep 17 00:00:00 2001 From: dawe Date: Wed, 28 Feb 2024 16:20:41 +0100 Subject: [PATCH 2/4] temporarily change to my fork of fsharp --- Directory.Build.props | 2 +- build.fsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 9973fd35de..74086ba50d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -46,7 +46,7 @@ Some common use cases include: - 2e95cbcc2cdf0317df6d5724cd62b15da4cea02b + 369bbfb8396b83c9d94dd1f52d2e99543fa74697 diff --git a/build.fsx b/build.fsx index 33ebfaa07e..85b01d0500 100644 --- a/build.fsx +++ b/build.fsx @@ -207,7 +207,7 @@ let downloadCompilerFile commitHash relativePath = let fs = file.Create() let fileName = Path.GetFileName(relativePath) let url = - $"https://raw.githubusercontent.com/dotnet/fsharp/{commitHash}/{relativePath}" + $"https://raw.githubusercontent.com/dawedawe/fsharp/{commitHash}/{relativePath}" let! response = Http.AsyncRequestStream( url, From 9924062216d248754465c56fece27c188d921b30 Mon Sep 17 00:00:00 2001 From: dawe Date: Fri, 1 Mar 2024 14:52:52 +0100 Subject: [PATCH 3/4] switch back to official dotnet repo for fsc --- CHANGELOG.md | 2 +- Directory.Build.props | 2 +- build.fsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5566ed701..78824d67b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## [Unreleased] ### Changed -* Update FCS to 'fix wrong range start of INTERP_STRING_END', commit 2e95cbcc2cdf0317df6d5724cd62b15da4cea02b [#3052](https://github.com/fsprojects/fantomas/pull/3052) +* Update FCS to 'Fix range start of INTERP_STRING_PART', commit 1da032a64321c77782e8d125afd3bf29863c3d9c [#3052](https://github.com/fsprojects/fantomas/pull/3052) ### Fixed * Equals sign should only be on same line if last tuple is multiline. [#3040](https://github.com/fsprojects/fantomas/issues/3040) diff --git a/Directory.Build.props b/Directory.Build.props index 74086ba50d..06859a4e86 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -46,7 +46,7 @@ Some common use cases include: - 369bbfb8396b83c9d94dd1f52d2e99543fa74697 + 1da032a64321c77782e8d125afd3bf29863c3d9c diff --git a/build.fsx b/build.fsx index 85b01d0500..33ebfaa07e 100644 --- a/build.fsx +++ b/build.fsx @@ -207,7 +207,7 @@ let downloadCompilerFile commitHash relativePath = let fs = file.Create() let fileName = Path.GetFileName(relativePath) let url = - $"https://raw.githubusercontent.com/dawedawe/fsharp/{commitHash}/{relativePath}" + $"https://raw.githubusercontent.com/dotnet/fsharp/{commitHash}/{relativePath}" let! response = Http.AsyncRequestStream( url, From 523bf0949fc6d8c9f4a189ec9d7af57402c0abe6 Mon Sep 17 00:00:00 2001 From: dawe Date: Fri, 1 Mar 2024 16:56:15 +0100 Subject: [PATCH 4/4] alpha 8 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78824d67b6..a1fff01a06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [Unreleased] +## 6.3.0-alpha-008 - 2024-03-01 ### Changed * Update FCS to 'Fix range start of INTERP_STRING_PART', commit 1da032a64321c77782e8d125afd3bf29863c3d9c [#3052](https://github.com/fsprojects/fantomas/pull/3052)