From ee8544bbbdeaa922c29f0a1d1c2cbe19055e8c52 Mon Sep 17 00:00:00 2001 From: nojaf Date: Wed, 20 Nov 2024 13:05:09 +0100 Subject: [PATCH 1/2] Update FCS and tools --- .config/dotnet-tools.json | 4 +- Directory.Packages.props | 6 +-- global.json | 3 +- .../GenerateModel.fs | 11 +--- .../CodeFormat.fs | 12 +---- src/FSharp.Formatting.CodeFormat/Pervasive.fs | 8 +-- src/FSharp.Formatting.Literate/Literate.fs | 21 ++------ src/FSharp.Formatting.Markdown/Markdown.fs | 50 ++++--------------- .../FSharp.Formatting.fsproj | 2 +- src/fsdocs-tool/BuildCommand.fs | 7 +-- src/fsdocs-tool/ProjectCracker.fs | 11 +--- src/fsdocs-tool/fsdocs-tool.fsproj | 2 +- 12 files changed, 30 insertions(+), 107 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index b902040da..d31c2ebd5 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "fantomas": { - "version": "6.3.0-alpha-003", + "version": "6.3.16", "commands": [ "fantomas" ] @@ -15,7 +15,7 @@ ] }, "dotnet-repl": { - "version": "0.1.208", + "version": "0.1.216", "commands": [ "dotnet-repl" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 07d878ee3..481969f41 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,8 +6,8 @@ - - + + @@ -18,7 +18,7 @@ - + diff --git a/global.json b/global.json index 5ce849551..4e550c173 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,6 @@ { "sdk": { - "version": "8.0.100" + "version": "8.0.400", + "rollForward": "latestMinor" } } diff --git a/src/FSharp.Formatting.ApiDocs/GenerateModel.fs b/src/FSharp.Formatting.ApiDocs/GenerateModel.fs index 218f64d41..7c509fac7 100644 --- a/src/FSharp.Formatting.ApiDocs/GenerateModel.fs +++ b/src/FSharp.Formatting.ApiDocs/GenerateModel.fs @@ -2912,15 +2912,8 @@ type ApiDocInput = } static member FromFile - ( - assemblyPath: string, - ?mdcomments, - ?substitutions, - ?sourceRepo, - ?sourceFolder, - ?publicOnly, - ?warn - ) = + (assemblyPath: string, ?mdcomments, ?substitutions, ?sourceRepo, ?sourceFolder, ?publicOnly, ?warn) + = { Path = assemblyPath XmlFile = None SourceFolder = sourceFolder diff --git a/src/FSharp.Formatting.CodeFormat/CodeFormat.fs b/src/FSharp.Formatting.CodeFormat/CodeFormat.fs index 5037d8a07..176156270 100644 --- a/src/FSharp.Formatting.CodeFormat/CodeFormat.fs +++ b/src/FSharp.Formatting.CodeFormat/CodeFormat.fs @@ -40,17 +40,7 @@ type CodeFormat = /// Formats the .fsx snippets as HTML. The parameters specify prefix for HTML tags, whether lines should /// be added to outputs and whether errors should be printed. static member FormatHtml - ( - snippets, - prefix, - ?openTag, - ?closeTag, - ?lineNumbers, - ?openLinesTag, - ?closeLinesTag, - ?addErrors, - ?tokenKindToCss - ) = + (snippets, prefix, ?openTag, ?closeTag, ?lineNumbers, ?openLinesTag, ?closeLinesTag, ?addErrors, ?tokenKindToCss) = let openTag = defaultArg openTag "
"
 
         let closeTag = defaultArg closeTag "
" diff --git a/src/FSharp.Formatting.CodeFormat/Pervasive.fs b/src/FSharp.Formatting.CodeFormat/Pervasive.fs index 524cd2bae..14c649f77 100644 --- a/src/FSharp.Formatting.CodeFormat/Pervasive.fs +++ b/src/FSharp.Formatting.CodeFormat/Pervasive.fs @@ -134,12 +134,8 @@ type CheckResults = type FSharpChecker with member this.ParseAndCheckDocument - ( - filePath: string, - sourceText: string, - options: FSharpProjectOptions, - allowStaleResults: bool - ) : Async<(FSharpParseFileResults * ParsedInput * FSharpCheckFileResults) option> = + (filePath: string, sourceText: string, options: FSharpProjectOptions, allowStaleResults: bool) + : Async<(FSharpParseFileResults * ParsedInput * FSharpCheckFileResults) option> = let parseAndCheckFile = async { let! parseResults, checkFileAnswer = diff --git a/src/FSharp.Formatting.Literate/Literate.fs b/src/FSharp.Formatting.Literate/Literate.fs index 3723adc47..fd363a18e 100644 --- a/src/FSharp.Formatting.Literate/Literate.fs +++ b/src/FSharp.Formatting.Literate/Literate.fs @@ -234,15 +234,8 @@ type Literate private () = /// /// static member ParsePynbString - ( - content, - ?path, - ?definedSymbols, - ?references, - ?parseOptions, - ?rootInputFolder, - ?onError - ) = + (content, ?path, ?definedSymbols, ?references, ?parseOptions, ?rootInputFolder, ?onError) + = let onError = defaultArg onError ignore let ctx = parsingContext None None definedSymbols onError @@ -361,15 +354,7 @@ type Literate private () = /// Format the literate document as Latex without using a template static member ToLatex - ( - doc: LiterateDocument, - ?prefix, - ?lineNumbers, - ?generateAnchors, - ?substitutions, - ?crefResolver, - ?mdlinkResolver - ) = + (doc: LiterateDocument, ?prefix, ?lineNumbers, ?generateAnchors, ?substitutions, ?crefResolver, ?mdlinkResolver) = let crefResolver = defaultArg crefResolver (fun _ -> None) let mdlinkResolver = defaultArg mdlinkResolver (fun _ -> None) diff --git a/src/FSharp.Formatting.Markdown/Markdown.fs b/src/FSharp.Formatting.Markdown/Markdown.fs index c4574efed..6cb5e6249 100644 --- a/src/FSharp.Formatting.Markdown/Markdown.fs +++ b/src/FSharp.Formatting.Markdown/Markdown.fs @@ -102,14 +102,8 @@ type Markdown internal () = /// Transform Markdown text into HTML format. The result /// will be written to the provided TextWriter. static member WriteHtml - ( - markdownText: string, - writer: TextWriter, - ?newline, - ?substitutions, - ?crefResolver, - ?mdlinkResolver - ) = + (markdownText: string, writer: TextWriter, ?newline, ?substitutions, ?crefResolver, ?mdlinkResolver) + = let doc = Markdown.Parse(markdownText, ?newline = newline) Markdown.WriteHtml( @@ -154,15 +148,7 @@ type Markdown internal () = /// Transform the provided MarkdownDocument into LaTeX /// format and write the result to a given writer. static member WriteLatex - ( - doc: MarkdownDocument, - writer, - ?newline, - ?substitutions, - ?crefResolver, - ?mdlinkResolver, - ?lineNumbers - ) = + (doc: MarkdownDocument, writer, ?newline, ?substitutions, ?crefResolver, ?mdlinkResolver, ?lineNumbers) = let newline = defaultArg newline Environment.NewLine let substitutions = defaultArg substitutions [] let crefResolver = defaultArg crefResolver (fun _ -> None) @@ -182,14 +168,8 @@ type Markdown internal () = /// Transform Markdown document into LaTeX format. The result /// will be written to the provided TextWriter. static member WriteLatex - ( - markdownText, - writer: TextWriter, - ?newline, - ?substitutions, - ?crefResolver, - ?mdlinkResolver - ) = + (markdownText, writer: TextWriter, ?newline, ?substitutions, ?crefResolver, ?mdlinkResolver) + = let doc = Markdown.Parse(markdownText, ?newline = newline) Markdown.WriteLatex( @@ -204,14 +184,8 @@ type Markdown internal () = /// Transform the provided MarkdownDocument into LaTeX /// format and return the result as a string. static member ToLatex - ( - doc: MarkdownDocument, - ?newline, - ?substitutions, - ?crefResolver, - ?mdlinkResolver, - ?lineNumbers - ) = + (doc: MarkdownDocument, ?newline, ?substitutions, ?crefResolver, ?mdlinkResolver, ?lineNumbers) + = let sb = new System.Text.StringBuilder() use wr = new StringWriter(sb) @@ -229,14 +203,8 @@ type Markdown internal () = /// Transform Markdown text into LaTeX format. The result will be returned as a string. static member ToLatex - ( - markdownText: string, - ?newline, - ?substitutions, - ?crefResolver, - ?mdlinkResolver, - ?lineNumbers - ) = + (markdownText: string, ?newline, ?substitutions, ?crefResolver, ?mdlinkResolver, ?lineNumbers) + = let doc = Markdown.Parse(markdownText, ?newline = newline) Markdown.ToLatex( diff --git a/src/FSharp.Formatting/FSharp.Formatting.fsproj b/src/FSharp.Formatting/FSharp.Formatting.fsproj index 1f0f340ed..5287e7a13 100644 --- a/src/FSharp.Formatting/FSharp.Formatting.fsproj +++ b/src/FSharp.Formatting/FSharp.Formatting.fsproj @@ -32,7 +32,7 @@
- + diff --git a/src/fsdocs-tool/BuildCommand.fs b/src/fsdocs-tool/BuildCommand.fs index e00d48376..d10d24d1c 100644 --- a/src/fsdocs-tool/BuildCommand.fs +++ b/src/fsdocs-tool/BuildCommand.fs @@ -687,11 +687,8 @@ type internal DocContent | _ -> () |] member _.GetNavigationEntries - ( - input, - docModels: (string * bool * LiterateDocModel) list, - currentPagePath: string option - ) = + (input, docModels: (string * bool * LiterateDocModel) list, currentPagePath: string option) + = let modelsForList = [ for thing in docModels do match thing with diff --git a/src/fsdocs-tool/ProjectCracker.fs b/src/fsdocs-tool/ProjectCracker.fs index 5519d67c8..65821b483 100644 --- a/src/fsdocs-tool/ProjectCracker.fs +++ b/src/fsdocs-tool/ProjectCracker.fs @@ -408,15 +408,8 @@ module Crack = | Error e -> raise (exn ("cannot load the sln", e)) let crackProjects - ( - onError, - extraMsbuildProperties, - userRoot, - userCollectionName, - userParameters, - projects, - ignoreProjects - ) = + (onError, extraMsbuildProperties, userRoot, userCollectionName, userParameters, projects, ignoreProjects) + = let slnDir = Path.GetFullPath "." //printfn "x.projects = %A" x.projects diff --git a/src/fsdocs-tool/fsdocs-tool.fsproj b/src/fsdocs-tool/fsdocs-tool.fsproj index f30c81c08..c1890fed1 100644 --- a/src/fsdocs-tool/fsdocs-tool.fsproj +++ b/src/fsdocs-tool/fsdocs-tool.fsproj @@ -3,7 +3,7 @@ Exe fsdocs - net6.0 + net8.0 fsdocs-tool LatestMajor true From bffe22e107f863012311135d7afa37c01875f819 Mon Sep 17 00:00:00 2001 From: nojaf Date: Wed, 20 Nov 2024 13:13:52 +0100 Subject: [PATCH 2/2] Add changelog entry --- RELEASE_NOTES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 1f81c3881..4c13f0b80 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,10 @@ # Changelog +## 21.0.0-beta-004 - 2024-11-20 + +### Changed +* Update FCS to 43.9.100. [#945](https://github.com/fsprojects/FSharp.Formatting/pull/945) + ## 21.0.0-beta-003 - 2024-08-06 ### Changed