1 Commits

Author SHA1 Message Date
Smaug123
7d452ea533 WIP 2025-07-24 08:42:00 +01:00
2 changed files with 5 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ namespace WoofWare.Expect
open System open System
open System.Text.RegularExpressions open System.Text.RegularExpressions
open Fantomas.FCS.Text
type private StringLiteralInfo = type private StringLiteralInfo =
{ {
@@ -207,6 +208,7 @@ module internal SnapshotUpdate =
/// instead returns the new contents. /// instead returns the new contents.
/// We always write single-quoted @-strings for simplicity. /// We always write single-quoted @-strings for simplicity.
let private updateSnapshot (lines : string[]) (info : StringLiteralInfo) (newContent : string) : string[] = let private updateSnapshot (lines : string[]) (info : StringLiteralInfo) (newContent : string) : string[] =
let f, _ = Fantomas.FCS.Parse.parseFile false (SourceText.ofString (String.concat "\n" lines)) []
let newString = "@\"" + newContent.Replace ("\"", "\"\"") + "\"" let newString = "@\"" + newContent.Replace ("\"", "\"\"") + "\""
if info.StartLine = info.EndLine then if info.StartLine = info.EndLine then

View File

@@ -36,8 +36,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<!-- FSharp.SystemTextJson requires at least this version --> <!-- Fantomas.FCS requires at least this version -->
<PackageReference Update="FSharp.Core" Version="4.7.0" /> <PackageReference Update="FSharp.Core" Version="8.0.100" />
<PackageReference Include="Fantomas.FCS" Version="7.0.3" />
<PackageReference Include="FSharp.SystemTextJson" Version="1.4.36" /> <PackageReference Include="FSharp.SystemTextJson" Version="1.4.36" />
<!-- Needed for DeepEquals --> <!-- Needed for DeepEquals -->
<PackageReference Include="System.Text.Json" Version="9.0.0" /> <PackageReference Include="System.Text.Json" Version="9.0.0" />