From 24eef0ad5b41adb0af0e6b65f0be6cd4e5e414d1 Mon Sep 17 00:00:00 2001 From: Petr Date: Tue, 11 Apr 2023 17:50:10 +0200 Subject: [PATCH 1/2] Update CodeFixHelpers.fs --- vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs b/vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs index 10c9f760ad..a656c9ac9e 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs @@ -19,15 +19,12 @@ module internal CodeFixHelpers = computeTextChanges: unit -> Async ) = - // I don't understand how we can get anything but a single diagnostic here - as we get a single "title" here. - // But since we don't have proper testing yet, keeping it like this to verify this theory in telemetry. - let ids = context.Diagnostics |> Seq.map (fun d -> d.Id) |> String.concat "," + let ids = context.Diagnostics |> Seq.exactlyOne let props: (string * obj) list = [ "name", name "ids", ids - "title", title // The following can help building a unique but anonymized codefix target: // #projectid#documentid#span From d69fc78d0c17659fde948e03a6ba72fe7e36b89a Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 13 Apr 2023 14:27:31 +0200 Subject: [PATCH 2/2] Update CodeFixHelpers.fs --- vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs b/vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs index a656c9ac9e..9c96071c01 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs @@ -19,7 +19,10 @@ module internal CodeFixHelpers = computeTextChanges: unit -> Async ) = - let ids = context.Diagnostics |> Seq.exactlyOne + // Currently there should be one Id here. + // Keeping it this way to be error- and futureproof + // as the underlying API does allow multiple Ids here. + let ids = context.Diagnostics |> Seq.map (fun d -> d.Id) |> String.concat "," let props: (string * obj) list = [