From 9e357ca5f82f5e800b259cbda7d91507b41d2e9a Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Tue, 14 Nov 2023 16:36:35 +0100 Subject: [PATCH] respect line limit in quick info (#16208) --- .../src/FSharp.Editor/DocComments/XMLDocumentation.fs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs index b48991fb350..e24b89cc609 100644 --- a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs +++ b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs @@ -78,10 +78,12 @@ type internal TextSanitizingCollector(collector, ?lineLimit: int) = interface ITaggedTextCollector with member _.Add taggedText = - // TODO: bail out early if line limit is already hit - match taggedText.Tag with - | TextTag.Text -> reportTextLines taggedText.Text - | _ -> addTaggedTextEntry taggedText + match lineLimit with + | Some lineLimit when lineLimit < count -> () + | _ -> + match taggedText.Tag with + | TextTag.Text -> reportTextLines taggedText.Text + | _ -> addTaggedTextEntry taggedText member _.IsEmpty = isEmpty member _.EndsWithLineBreak = isEmpty || endsWithLineBreak