From c497ec9869694aef67fd9db9f3159d8463d13ff4 Mon Sep 17 00:00:00 2001 From: Matthijs Prent Date: Fri, 13 Sep 2024 09:15:45 +0200 Subject: [PATCH 1/4] fixed a bug that reported that a unit parameter should have a name --- src/FSharp.Formatting.ApiDocs/GenerateModel.fs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/FSharp.Formatting.ApiDocs/GenerateModel.fs b/src/FSharp.Formatting.ApiDocs/GenerateModel.fs index 9b406e67..8353f716 100644 --- a/src/FSharp.Formatting.ApiDocs/GenerateModel.fs +++ b/src/FSharp.Formatting.ApiDocs/GenerateModel.fs @@ -23,6 +23,7 @@ open FSharp.Formatting.Templating open FSharp.Patterns open FSharp.Compiler.Syntax + [] module internal Utils = @@ -346,10 +347,14 @@ type ApiDocMember m.StartColumn pn - for (_psym, pnm, _pn, _pty) in paramTypes do + for (psym, pnm, _pn, _pty) in paramTypes do match pnm with | None -> - printfn "%s(%d,%d): warning: a parameter was missing a name" m.FileName m.StartLine m.StartColumn + match psym with + | Choice1Of2 p -> + if isUnitType p.Type |> not then + printfn "%s(%d,%d): warning: a parameter was missing a name" m.FileName m.StartLine m.StartColumn + | Choice2Of2 _ -> () | Some nm -> if not (tdocs.ContainsKey pnm) then printfn From f5fd99374fd8b09b4f209598f620998f537d428c Mon Sep 17 00:00:00 2001 From: Matthijs Prent Date: Fri, 13 Sep 2024 09:18:12 +0200 Subject: [PATCH 2/4] removed added newline --- src/FSharp.Formatting.ApiDocs/GenerateModel.fs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/FSharp.Formatting.ApiDocs/GenerateModel.fs b/src/FSharp.Formatting.ApiDocs/GenerateModel.fs index 8353f716..fd078db2 100644 --- a/src/FSharp.Formatting.ApiDocs/GenerateModel.fs +++ b/src/FSharp.Formatting.ApiDocs/GenerateModel.fs @@ -23,7 +23,6 @@ open FSharp.Formatting.Templating open FSharp.Patterns open FSharp.Compiler.Syntax - [] module internal Utils = From ae98135bd70d9c8be34e3a2a68860fde06961c1e Mon Sep 17 00:00:00 2001 From: Matthijs Prent Date: Fri, 13 Sep 2024 11:36:09 +0200 Subject: [PATCH 3/4] Changed to printing an error for fields as well --- src/FSharp.Formatting.ApiDocs/GenerateModel.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FSharp.Formatting.ApiDocs/GenerateModel.fs b/src/FSharp.Formatting.ApiDocs/GenerateModel.fs index fd078db2..51050465 100644 --- a/src/FSharp.Formatting.ApiDocs/GenerateModel.fs +++ b/src/FSharp.Formatting.ApiDocs/GenerateModel.fs @@ -353,7 +353,8 @@ type ApiDocMember | Choice1Of2 p -> if isUnitType p.Type |> not then printfn "%s(%d,%d): warning: a parameter was missing a name" m.FileName m.StartLine m.StartColumn - | Choice2Of2 _ -> () + | Choice2Of2 _ -> + printfn "%s(%d,%d): warning: a field was missing a name" m.FileName m.StartLine m.StartColumn | Some nm -> if not (tdocs.ContainsKey pnm) then printfn From ee74bbc6e0dcbdd516038e61d5f85cf4bc1e635b Mon Sep 17 00:00:00 2001 From: Matthijs Prent Date: Fri, 13 Sep 2024 12:22:36 +0200 Subject: [PATCH 4/4] formatting --- src/FSharp.Formatting.ApiDocs/GenerateModel.fs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/FSharp.Formatting.ApiDocs/GenerateModel.fs b/src/FSharp.Formatting.ApiDocs/GenerateModel.fs index 51050465..218f64d4 100644 --- a/src/FSharp.Formatting.ApiDocs/GenerateModel.fs +++ b/src/FSharp.Formatting.ApiDocs/GenerateModel.fs @@ -352,9 +352,13 @@ type ApiDocMember match psym with | Choice1Of2 p -> if isUnitType p.Type |> not then - printfn "%s(%d,%d): warning: a parameter was missing a name" m.FileName m.StartLine m.StartColumn + printfn + "%s(%d,%d): warning: a parameter was missing a name" + m.FileName + m.StartLine + m.StartColumn | Choice2Of2 _ -> - printfn "%s(%d,%d): warning: a field was missing a name" m.FileName m.StartLine m.StartColumn + printfn "%s(%d,%d): warning: a field was missing a name" m.FileName m.StartLine m.StartColumn | Some nm -> if not (tdocs.ContainsKey pnm) then printfn