From 4d1f7c40dd09f805d3de2117e721bd652d51dc6f Mon Sep 17 00:00:00 2001 From: ijklam Date: Sat, 9 Dec 2023 20:51:09 +0800 Subject: [PATCH 1/5] make `remarks` and `returns` visible in quick info --- .../DocComments/XMLDocumentation.fs | 22 +++++++++++++++++-- .../src/FSharp.Editor/FSharp.Editor.resx | 6 +++++ .../FSharp.Editor/xlf/FSharp.Editor.cs.xlf | 10 +++++++++ .../FSharp.Editor/xlf/FSharp.Editor.de.xlf | 10 +++++++++ .../FSharp.Editor/xlf/FSharp.Editor.es.xlf | 10 +++++++++ .../FSharp.Editor/xlf/FSharp.Editor.fr.xlf | 10 +++++++++ .../FSharp.Editor/xlf/FSharp.Editor.it.xlf | 10 +++++++++ .../FSharp.Editor/xlf/FSharp.Editor.ja.xlf | 10 +++++++++ .../FSharp.Editor/xlf/FSharp.Editor.ko.xlf | 10 +++++++++ .../FSharp.Editor/xlf/FSharp.Editor.pl.xlf | 10 +++++++++ .../FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf | 10 +++++++++ .../FSharp.Editor/xlf/FSharp.Editor.ru.xlf | 10 +++++++++ .../FSharp.Editor/xlf/FSharp.Editor.tr.xlf | 10 +++++++++ .../xlf/FSharp.Editor.zh-Hans.xlf | 10 +++++++++ .../xlf/FSharp.Editor.zh-Hant.xlf | 10 +++++++++ 15 files changed, 156 insertions(+), 2 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs index 1c807bfad91..89a290dbbef 100644 --- a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs +++ b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs @@ -165,6 +165,7 @@ module internal XmlDocumentation = | "typeref" -> for attr in el.Attributes() do WriteAttribute collector attr "name" (tagParameter >> collector.Add) + | "br" -> AppendHardLine collector | _ -> WriteNodes collector (el.Nodes()) | _ -> () @@ -217,6 +218,23 @@ module internal XmlDocumentation = EnsureHardLine collector WriteElement collector el + match Seq.tryHead (doc.Descendants(XName.op_Implicit "remarks")) with + | None -> () + | Some el -> + AppendHardLine collector + AppendOnNewLine collector (SR.RemarksHeader()) + AppendHardLine collector + WriteElement collector el + + match Seq.tryHead (doc.Descendants(XName.op_Implicit "returns")) with + | None -> () + | Some el -> + AppendHardLine collector + AppendOnNewLine collector (SR.ReturnsHeader()) + AppendHardLine collector + collector.Add(tagSpace " ") + WriteElement collector el + member this.CollectParameter(collector: ITaggedTextCollector, paramName: string) = match tryFindParameter paramName with | None -> () @@ -338,9 +356,9 @@ module internal XmlDocumentation = try match GetMemberIndexOfAssembly(fileName) with | Some(index) -> - let _, idx = index.ParseMemberSignature(signature) + let ok, idx = index.ParseMemberSignature(signature) - if idx <> 0u then + if Com.Succeeded(ok) then let ok, xml = index.GetMemberXML(idx) if Com.Succeeded(ok) then diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx index 4b41551aac0..6492f005335 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx @@ -355,4 +355,10 @@ Use live (unsaved) buffers for analysis Remove unnecessary parentheses + + Remarks: + + + Returns: + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index 5db40f51628..55148d4c883 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -206,6 +206,11 @@ Tečkované podtržení; Přerušované podtržení; + + Remarks: + Remarks: + + Remove 'return' Odebrat return @@ -241,6 +246,11 @@ Přerušované podtržení; Přejmenujte {0} na _. + + Returns: + Returns: + + Simplify name Zjednodušte název. diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf index 31ffc4c8342..28f0da28f7c 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -206,6 +206,11 @@ Punkt unterstrichen; Strich unterstrichen; + + Remarks: + Remarks: + + Remove 'return' "return" entfernen @@ -241,6 +246,11 @@ Strich unterstrichen; "{0}" in "_" umbenennen + + Returns: + Returns: + + Simplify name Namen vereinfachen diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index dceb8706e99..970764d23d5 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -208,6 +208,11 @@ Subrayado de punto; Subrayado de guion; + + Remarks: + Remarks: + + Remove 'return' Quitar "return" @@ -243,6 +248,11 @@ Subrayado de guion; Cambiar nombre de "{0}" por "_" + + Returns: + Returns: + + Simplify name Simplificar nombre diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf index db53640c9a5..4e2f0f4f26f 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -206,6 +206,11 @@ Soulignement pointé ; Soulignement en tirets ; + + Remarks: + Remarks: + + Remove 'return' Supprimer 'return' @@ -241,6 +246,11 @@ Soulignement en tirets ; Renommer '{0}' en '_' + + Returns: + Returns: + + Simplify name Simplifier le nom diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf index 97feb5816e2..dc380aa10f7 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -206,6 +206,11 @@ Sottolineatura a punto; Sottolineatura a trattini; + + Remarks: + Remarks: + + Remove 'return' Rimuovi 'return' @@ -241,6 +246,11 @@ Sottolineatura a trattini; Rinomina '{0}' in '_' + + Returns: + Returns: + + Simplify name Semplifica nome diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index f9682a8d5fd..535d8e37a29 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -206,6 +206,11 @@ F# 構文規則に準拠するよう、改行を追加して指定された幅 ダッシュ下線; + + Remarks: + Remarks: + + Remove 'return' 'return' の削除 @@ -241,6 +246,11 @@ F# 構文規則に準拠するよう、改行を追加して指定された幅 '{0}' から '_' に名前を変更する + + Returns: + Returns: + + Simplify name 名前を単純化する diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index 638099fe0fb..916cd46ccd6 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -207,6 +207,11 @@ F# 구문 규칙에 맞는 줄바꿈을 추가하여 지정된 너비에 서명 대시 밑줄; + + Remarks: + Remarks: + + Remove 'return' 'return' 제거 @@ -242,6 +247,11 @@ F# 구문 규칙에 맞는 줄바꿈을 추가하여 지정된 너비에 서명 '{0}'의 이름을 '_'로 바꾸기 + + Returns: + Returns: + + Simplify name 이름 단순화 diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf index cc17e6d540e..666a671e084 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -206,6 +206,11 @@ Podkreślenie kropką; Podkreślenie kreską; + + Remarks: + Remarks: + + Remove 'return' Usuń element „return” @@ -241,6 +246,11 @@ Podkreślenie kreską; Zmień nazwę z „{0}” na „_” + + Returns: + Returns: + + Simplify name Uprość nazwę diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index 492073cacb0..31d6ac6224e 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -206,6 +206,11 @@ Ponto sublinhado; Traço sublinhado; + + Remarks: + Remarks: + + Remove 'return' Remover 'return' @@ -241,6 +246,11 @@ Traço sublinhado; Renomear '{0}' para '_' + + Returns: + Returns: + + Simplify name Simplificar o nome diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index b8549511a9f..6e1037606f0 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -206,6 +206,11 @@ Dash underline; Штриховое подчеркивание; + + Remarks: + Remarks: + + Remove 'return' Удалить "return" @@ -241,6 +246,11 @@ Dash underline; Переименовать "{0}" в "_" + + Returns: + Returns: + + Simplify name Упростить имя diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index e6e9332dc33..900381fd586 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -206,6 +206,11 @@ Nokta alt çizgi; Tire alt çizgisi; + + Remarks: + Remarks: + + Remove 'return' 'return' öğesini kaldır @@ -241,6 +246,11 @@ Tire alt çizgisi; '{0}' öğesini '_' olarak yeniden adlandırma + + Returns: + Returns: + + Simplify name Adı basitleştirme diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index 6df4f779a61..705a1e08771 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -206,6 +206,11 @@ Dash underline; 短划线下划线; + + Remarks: + Remarks: + + Remove 'return' 删除 "return" @@ -241,6 +246,11 @@ Dash underline; 将“{0}”重命名为“_” + + Returns: + Returns: + + Simplify name 简化名称 diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf index d270271bb75..1845cc6940a 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -206,6 +206,11 @@ Dash underline; 虛線底線; + + Remarks: + Remarks: + + Remove 'return' 移除 'return' @@ -241,6 +246,11 @@ Dash underline; 將 '{0}' 重新命名為 '_' + + Returns: + Returns: + + Simplify name 簡化名稱 From a7f5d23bf34b691adc5ee24de7d52e59807133ff Mon Sep 17 00:00:00 2001 From: ijklam Date: Sun, 10 Dec 2023 12:43:28 +0800 Subject: [PATCH 2/5] move `remarks` to the end of summarys add an option to control visibility of `remarks` --- .../Completion/CompletionProvider.fs | 4 +- .../Completion/CompletionService.fs | 2 +- .../FSharp.Editor/Completion/SignatureHelp.fs | 32 ++-- .../DocComments/XMLDocumentation.fs | 59 ++++--- .../src/FSharp.Editor/FSharp.Editor.resx | 3 +- .../FSharp.Editor/Options/EditorOptions.fs | 3 + .../QuickInfo/QuickInfoProvider.fs | 2 +- .../FSharp.Editor/xlf/FSharp.Editor.cs.xlf | 5 +- .../FSharp.Editor/xlf/FSharp.Editor.de.xlf | 5 +- .../FSharp.Editor/xlf/FSharp.Editor.es.xlf | 5 +- .../FSharp.Editor/xlf/FSharp.Editor.fr.xlf | 5 +- .../FSharp.Editor/xlf/FSharp.Editor.it.xlf | 5 +- .../FSharp.Editor/xlf/FSharp.Editor.ja.xlf | 5 +- .../FSharp.Editor/xlf/FSharp.Editor.ko.xlf | 5 +- .../FSharp.Editor/xlf/FSharp.Editor.pl.xlf | 5 +- .../FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf | 5 +- .../FSharp.Editor/xlf/FSharp.Editor.ru.xlf | 5 +- .../FSharp.Editor/xlf/FSharp.Editor.tr.xlf | 5 +- .../xlf/FSharp.Editor.zh-Hans.xlf | 5 +- .../xlf/FSharp.Editor.zh-Hant.xlf | 5 +- .../QuickInfoOptionControl.xaml | 50 ++++-- .../FSharp.UIResources/Strings.Designer.cs | 147 ++++++++++-------- .../src/FSharp.UIResources/Strings.resx | 3 + .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.de.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.es.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.it.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 5 + .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 5 + .../xlf/Strings.zh-Hans.xlf | 5 + .../xlf/Strings.zh-Hant.xlf | 5 + 36 files changed, 288 insertions(+), 147 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index 0014f1d2397..09fbc90af46 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -26,7 +26,7 @@ open CancellableTasks module Logger = Microsoft.VisualStudio.FSharp.Editor.Logger type internal FSharpCompletionProvider - (workspace: Workspace, serviceProvider: SVsServiceProvider, assemblyContentProvider: AssemblyContentProvider) = + (workspace: Workspace, serviceProvider: SVsServiceProvider, assemblyContentProvider: AssemblyContentProvider, editorOptions: EditorOptions) = inherit FSharpCompletionProviderBase() @@ -380,7 +380,7 @@ type internal FSharpCompletionProvider let documentation = List() let collector = RoslynHelpers.CollectTaggedText documentation // mix main description and xmldoc by using one collector - XmlDocumentation.BuildDataTipText(documentationBuilder, collector, collector, collector, collector, collector, description) + XmlDocumentation.BuildDataTipText(documentationBuilder, collector, collector, collector, collector, collector, description, editorOptions.QuickInfo.ShowRemarks) Task.FromResult(CompletionDescription.Create(documentation.ToImmutableArray())) | _ -> diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs index 7975b31b155..13f7e3d3b30 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs @@ -24,7 +24,7 @@ type internal FSharpCompletionService let builtInProviders = ImmutableArray.Create( - FSharpCompletionProvider(workspace, serviceProvider, assemblyContentProvider), + FSharpCompletionProvider(workspace, serviceProvider, assemblyContentProvider, settings), FSharpCommonCompletionProvider.Create(HashDirectiveCompletionProvider.Create(workspace, projectInfoManager)) ) diff --git a/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs b/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs index 595f051900b..b877026000e 100644 --- a/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs +++ b/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs @@ -58,7 +58,7 @@ type SignatureHelpData = [] [)>] -type internal FSharpSignatureHelpProvider [] (serviceProvider: SVsServiceProvider) = +type internal FSharpSignatureHelpProvider [] (serviceProvider: SVsServiceProvider, editorOptions: EditorOptions) = let documentationBuilder = XmlDocumentation.CreateDocumentationBuilder(serviceProvider.XMLMemberIndexService) @@ -79,7 +79,8 @@ type internal FSharpSignatureHelpProvider [] (serviceProvi documentationBuilder: IDocumentationBuilder, sourceText: SourceText, caretPosition: int, - triggerIsTypedChar: char option + triggerIsTypedChar: char option, + editorOptions: EditorOptions ) = asyncMaybe { let textLines = sourceText.Lines @@ -206,7 +207,8 @@ type internal FSharpSignatureHelpProvider [] (serviceProvi RoslynHelpers.CollectTaggedText mainDescription, RoslynHelpers.CollectTaggedText documentation, method.Description, - false + false, + editorOptions.QuickInfo.ShowRemarks ) let parameters = @@ -225,7 +227,8 @@ type internal FSharpSignatureHelpProvider [] (serviceProvi documentationBuilder, RoslynHelpers.CollectTaggedText doc, method.XmlDoc, - p.ParameterName + p.ParameterName, + editorOptions.QuickInfo.ShowRemarks ) p.Display |> Seq.iter (RoslynHelpers.CollectTaggedText parts) @@ -292,7 +295,8 @@ type internal FSharpSignatureHelpProvider [] (serviceProvi sourceText: SourceText, caretPosition: int, adjustedColumnInSource: int, - filePath: string + filePath: string, + editorOptions: EditorOptions ) = asyncMaybe { let textLine = sourceText.Lines.GetLineFromPosition(adjustedColumnInSource) @@ -430,7 +434,8 @@ type internal FSharpSignatureHelpProvider [] (serviceProvi typeParameterMap.Add, usage.Add, exceptions.Add, - tooltip + tooltip, + editorOptions.QuickInfo.ShowRemarks ) let fsharpDocs = @@ -606,7 +611,8 @@ type internal FSharpSignatureHelpProvider [] (serviceProvi documentationBuilder: IDocumentationBuilder, caretPosition: int, triggerTypedChar: char option, - possibleCurrentSignatureHelpSessionKind: CurrentSignatureHelpSessionKind option + possibleCurrentSignatureHelpSessionKind: CurrentSignatureHelpSessionKind option, + editorOptions: EditorOptions ) = asyncMaybe { @@ -655,7 +661,8 @@ type internal FSharpSignatureHelpProvider [] (serviceProvi sourceText, caretPosition, adjustedColumnInSource, - document.FilePath + document.FilePath, + editorOptions ) | _, Some FunctionApplication when adjustedColumnChar <> ',' @@ -674,7 +681,8 @@ type internal FSharpSignatureHelpProvider [] (serviceProvi sourceText, caretPosition, adjustedColumnInSource, - document.FilePath + document.FilePath, + editorOptions ) | _ -> let! paramInfoLocations = parseResults.FindParameterLocations(Position.fromZ caretLinePos.Line caretLineColumn) @@ -688,7 +696,8 @@ type internal FSharpSignatureHelpProvider [] (serviceProvi documentationBuilder, sourceText, caretPosition, - triggerTypedChar + triggerTypedChar, + editorOptions ) } @@ -722,7 +731,8 @@ type internal FSharpSignatureHelpProvider [] (serviceProvi documentationBuilder, position, triggerTypedChar, - possibleCurrentSignatureHelpSessionKind + possibleCurrentSignatureHelpSessionKind, + editorOptions ) match signatureHelpDataOpt with diff --git a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs index 89a290dbbef..bd91c5f1212 100644 --- a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs +++ b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs @@ -100,6 +100,7 @@ type internal IDocumentationBuilder = processedXml: string * showExceptions: bool * showParameters: bool * + showRemarks: bool * paramName: string option -> unit @@ -111,6 +112,7 @@ type internal IDocumentationBuilder = signature: string * showExceptions: bool * showParameters: bool * + showRemarks: bool * paramName: string option -> unit @@ -211,30 +213,34 @@ module internal XmlDocumentation = with _ -> None - member _.CollectSummary(collector: ITaggedTextCollector) = + member _.CollectSummary(collector: ITaggedTextCollector, showRemarks) = match Seq.tryHead (doc.Descendants(XName.op_Implicit "summary")) with | None -> () | Some el -> EnsureHardLine collector WriteElement collector el - match Seq.tryHead (doc.Descendants(XName.op_Implicit "remarks")) with - | None -> () - | Some el -> - AppendHardLine collector - AppendOnNewLine collector (SR.RemarksHeader()) - AppendHardLine collector - WriteElement collector el - match Seq.tryHead (doc.Descendants(XName.op_Implicit "returns")) with | None -> () | Some el -> + AppendHardLine collector AppendHardLine collector AppendOnNewLine collector (SR.ReturnsHeader()) AppendHardLine collector collector.Add(tagSpace " ") WriteElement collector el + if showRemarks then + match Seq.tryHead (doc.Descendants(XName.op_Implicit "remarks")) with + | None -> () + | Some el -> + AppendHardLine collector + AppendHardLine collector + AppendOnNewLine collector (SR.RemarksHeader()) + AppendHardLine collector + collector.Add(tagSpace " ") + WriteElement collector el + member this.CollectParameter(collector: ITaggedTextCollector, paramName: string) = match tryFindParameter paramName with | None -> () @@ -312,11 +318,12 @@ module internal XmlDocumentation = exnCollector: ITaggedTextCollector, xmlDocReader: XmlDocReader, showExceptions, - showParameters + showParameters, + showRemarks ) = AppendHardLine xmlCollector xmlCollector.StartXMLDoc() - xmlDocReader.CollectSummary(xmlCollector) + xmlDocReader.CollectSummary(xmlCollector, showRemarks) if (showParameters) then xmlDocReader.CollectParameters xmlCollector @@ -333,13 +340,14 @@ module internal XmlDocumentation = processedXml, showExceptions, showParameters, + showRemarks, paramName ) = match XmlDocReader.TryCreate processedXml with | Some xmlDocReader -> match paramName with | Some paramName -> xmlDocReader.CollectParameter(xmlCollector, paramName) - | None -> AppendMemberData(xmlCollector, exnCollector, xmlDocReader, showExceptions, showParameters) + | None -> AppendMemberData(xmlCollector, exnCollector, xmlDocReader, showExceptions, showParameters, showRemarks) | None -> () /// Append Xml documentation contents into the StringBuilder @@ -351,6 +359,7 @@ module internal XmlDocumentation = signature: string, showExceptions: bool, showParameters: bool, + showRemarks, paramName: string option ) = try @@ -369,6 +378,7 @@ module internal XmlDocumentation = xml, showExceptions, showParameters, + showRemarks, paramName ) | None -> () @@ -385,6 +395,7 @@ module internal XmlDocumentation = xml, showExceptions, showParameters, + showRemarks, paramName ) = match xml with @@ -397,6 +408,7 @@ module internal XmlDocumentation = signature, showExceptions, showParameters, + showRemarks, paramName ) | FSharpXmlDoc.FromXmlText(xmlDoc) -> @@ -409,6 +421,7 @@ module internal XmlDocumentation = processedXml, showExceptions, showParameters, + showRemarks, paramName ) @@ -435,7 +448,7 @@ module internal XmlDocumentation = OverLoadsLimit = 5 } - let BuildSingleTipText (documentationProvider: IDocumentationBuilder, dataTipElement: ToolTipElement, limits: LineLimits) = + let BuildSingleTipText (documentationProvider: IDocumentationBuilder, dataTipElement: ToolTipElement, limits: LineLimits, showRemarks: bool) = let { LineLimit = lineLimit @@ -499,7 +512,7 @@ module internal XmlDocumentation = AppendHardLine usageCollector r |> Seq.iter usageCollector.Add) - AppendXmlComment(documentationProvider, xmlCollector, exnCollector, item0.XmlDoc, true, false, item0.ParamName) + AppendXmlComment(documentationProvider, xmlCollector, exnCollector, item0.XmlDoc, true, false, showRemarks, item0.ParamName) ProcessGenericParameters item0.TypeMapping @@ -523,7 +536,8 @@ module internal XmlDocumentation = exnCollector, showText, showExceptions, - showParameters + showParameters, + showRemarks ) = let textCollector: ITaggedTextCollector = TextSanitizingCollector(textCollector, lineLimit = 45) :> _ @@ -608,6 +622,7 @@ module internal XmlDocumentation = item0.XmlDoc, showExceptions, showParameters, + showRemarks, item0.ParamName ) @@ -632,7 +647,8 @@ module internal XmlDocumentation = typeParameterMapCollector, usageCollector, exnCollector, - ToolTipText(dataTipText) + ToolTipText(dataTipText), + showRemarks ) = BuildTipText( documentationProvider, @@ -644,10 +660,11 @@ module internal XmlDocumentation = exnCollector, true, true, - false + false, + showRemarks ) - let BuildMethodOverloadTipText (documentationProvider, textCollector, xmlCollector, ToolTipText(dataTipText), showParams) = + let BuildMethodOverloadTipText (documentationProvider, textCollector, xmlCollector, ToolTipText(dataTipText), showParams, showRemarks) = BuildTipText( documentationProvider, dataTipText, @@ -658,10 +675,11 @@ module internal XmlDocumentation = ignore, false, false, - showParams + showParams, + showRemarks ) - let BuildMethodParamText (documentationProvider, xmlCollector, xml, paramName) = + let BuildMethodParamText (documentationProvider, xmlCollector, xml, paramName, showRemarks) = AppendXmlComment( documentationProvider, TextSanitizingCollector(xmlCollector), @@ -669,6 +687,7 @@ module internal XmlDocumentation = xml, false, true, + showRemarks, Some paramName ) diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx index 6492f005335..41b80965895 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx @@ -180,7 +180,8 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; +Dash underline; +Show remarks in Quick Info Add an assembly reference to '{0}' diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index c531d386af3..250565319e7 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -46,6 +46,7 @@ type QuickInfoOptions = DisplayLinks: bool UnderlineStyle: QuickInfoUnderlineStyle DescriptionWidth: int option + ShowRemarks: bool } static member Default = @@ -53,6 +54,7 @@ type QuickInfoOptions = DisplayLinks = true UnderlineStyle = QuickInfoUnderlineStyle.Solid DescriptionWidth = None + ShowRemarks = true } [] @@ -199,6 +201,7 @@ module internal OptionsUI = bindRadioButton view.dash path QuickInfoUnderlineStyle.Dash bindCheckBox view.displayLinks (nameof QuickInfoOptions.Default.DisplayLinks) bindDescriptionWidthTextBox view.descriptionWidth (nameof QuickInfoOptions.Default.DescriptionWidth) + bindCheckBox view.showRemarks (nameof QuickInfoOptions.Default.ShowRemarks) upcast view [] diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs index ae79300ee85..e93c6bad038 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs @@ -31,7 +31,7 @@ type internal FSharpAsyncQuickInfoSource let getSingleContent (data: ToolTipElement) = let symbol, description, documentation = - XmlDocumentation.BuildSingleTipText(documentationBuilder, data, XmlDocumentation.DefaultLineLimits) + XmlDocumentation.BuildSingleTipText(documentationBuilder, data, XmlDocumentation.DefaultLineLimits, editorOptions.QuickInfo.ShowRemarks) let getLinkTooltip filePath = let solutionDir = Path.GetDirectoryName(document.Project.Solution.FilePath) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index 55148d4c883..7f90ad6a126 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -195,8 +195,9 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; - Formátování; +Dash underline; +Show remarks in Quick Info + Formátování; Upřednostňovaná šířka popisu ve znacích; Formátování podpisu na danou šířku přidáním konců řádků podle pravidel syntaxe F#; Navigační odkazy; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf index 28f0da28f7c..5e5261ef993 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -195,8 +195,9 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; - Formatierung; +Dash underline; +Show remarks in Quick Info + Formatierung; Bevorzugte Beschreibungsbreite in Zeichen; Signatur in der angegebenen Breite formatieren, indem Zeilenumbrüche hinzugefügt werden, die den F#-Syntaxregeln entsprechen; Navigationslinks; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index 970764d23d5..f130a461216 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -197,8 +197,9 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; - Formato; +Dash underline; +Show remarks in Quick Info + Formato; Ancho de descripción preferido en caracteres; Dar formato a la firma con el ancho dado agregando saltos de línea que cumplan las reglas de sintaxis de F#; Vínculos de navegación; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf index 4e2f0f4f26f..a3bc317a6af 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -195,8 +195,9 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; - Formatage; +Dash underline; +Show remarks in Quick Info + Formatage; Largeur de description préférée en caractères ; Mettre en forme la signature à la largeur donnée en ajoutant des sauts de ligne conformes aux règles de syntaxe F# ; Liens de navigation ; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf index dc380aa10f7..45fbdd6637c 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -195,8 +195,9 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; - Formattazione; +Dash underline; +Show remarks in Quick Info + Formattazione; Larghezza descrizione preferita in caratteri; Formatta la firma in base alla larghezza specificata aggiungendo interruzioni di riga conformi alle regole di sintassi F#; Collegamenti di spostamento; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index 535d8e37a29..09a35c432c9 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -195,8 +195,9 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; - 書式 設定; +Dash underline; +Show remarks in Quick Info + 書式 設定; 希望の説明の幅 (文字数); F# 構文規則に準拠するよう、改行を追加して指定された幅に署名を書式設定します; ナビゲーション リンク; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index 916cd46ccd6..32499ff0771 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -196,8 +196,9 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; - 서식; +Dash underline; +Show remarks in Quick Info + 서식; 기본 설정 문자 설명 너비; F# 구문 규칙에 맞는 줄바꿈을 추가하여 지정된 너비에 서명 서식 지정; 탐색 링크; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf index 666a671e084..589adf994b9 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -195,8 +195,9 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; - Formatowanie; +Dash underline; +Show remarks in Quick Info + Formatowanie; Preferowana szerokość opisu w znakach; Sformatuj sygnaturę na daną szerokość, dodając podziały wierszy zgodne z regułami składni języka F#; Linki nawigacji; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index 31d6ac6224e..8234f5190c7 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -195,8 +195,9 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; - Formatação; +Dash underline; +Show remarks in Quick Info + Formatação; Largura da descrição preferida em caracteres; Formate a assinatura para a largura especificada adicionando quebras de linha em conformidade com as regras de sintaxe do F#; Links de navegação; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index 6e1037606f0..d6447a61572 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -195,8 +195,9 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; - Форматирование; +Dash underline; +Show remarks in Quick Info + Форматирование; Предпочитаемая ширина описания в символах; Форматирование подписи до заданной ширины путем добавления разрывов строк в соответствии с правилами синтаксиса F#; Ссылки навигации; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index 900381fd586..56c3ca4e2d4 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -195,8 +195,9 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; - Biçimlendirme; +Dash underline; +Show remarks in Quick Info + Biçimlendirme; Karakter olarak tercih edilen açıklama genişliği; F# söz dizimi kurallarına uyan satır sonları ekleyerek imzayı verilen genişliğe biçimlendir; Gezinti bağlantıları; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index 705a1e08771..80d8c8362cc 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -195,8 +195,9 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; - 格式设置; +Dash underline; +Show remarks in Quick Info + 格式设置; 首选描述宽度 (以字符为单位); 通过添加符合 F# 语法规则的换行符,将签名格式设置为指定宽度; 导航链接; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf index 1845cc6940a..31b2ea7cec2 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -195,8 +195,9 @@ Navigation links; Show navigation links as; Solid underline; Dot underline; -Dash underline; - 格式化; +Dash underline; +Show remarks in Quick Info + 格式化; 慣用描述寬度 (以字元為單位); 透過新增符合 F# 語法規則的分行符號,將簽章格式設定為指定寬度; 瀏覽連結; diff --git a/vsintegration/src/FSharp.UIResources/QuickInfoOptionControl.xaml b/vsintegration/src/FSharp.UIResources/QuickInfoOptionControl.xaml index 528aa32b1cf..6b7c6531f48 100644 --- a/vsintegration/src/FSharp.UIResources/QuickInfoOptionControl.xaml +++ b/vsintegration/src/FSharp.UIResources/QuickInfoOptionControl.xaml @@ -1,16 +1,19 @@ - + - + @@ -20,21 +23,36 @@ - + - - - - + + + + + + + diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs index a7bcaa08413..57b599de866 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs +++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 // //------------------------------------------------------------------------------ @@ -13,12 +13,12 @@ namespace Microsoft.VisualStudio.FSharp.UIResources { /// - /// A strongly-typed resource class, for looking up localized strings, etc. + /// 一个强类型的资源类,用于查找本地化的字符串等。 /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] @@ -33,7 +33,7 @@ internal Strings() { } /// - /// Returns the cached ResourceManager instance used by this class. + /// 返回此类使用的缓存的 ResourceManager 实例。 /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ internal Strings() { } /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. + /// 重写当前线程的 CurrentUICulture 属性,对 + /// 使用此强类型资源类的所有资源查找执行重写。 /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { @@ -61,7 +61,7 @@ internal Strings() { } /// - /// Looks up a localized string similar to Additional performance telemetry (experimental). + /// 查找类似 Additional performance telemetry (experimental) 的本地化字符串。 /// public static string AdditionalTelemetry { get { @@ -70,7 +70,7 @@ public static string AdditionalTelemetry { } /// - /// Looks up a localized string similar to Always place open statements at the top level. + /// 查找类似 Always place open statements at the top level 的本地化字符串。 /// public static string Always_place_opens_at_top_level { get { @@ -79,7 +79,7 @@ public static string Always_place_opens_at_top_level { } /// - /// Looks up a localized string similar to Keep analyzing the entire solution for diagnostics as a low priority background task (requires restart). + /// 查找类似 Keep analyzing the entire solution for diagnostics as a low priority background task (requires restart) 的本地化字符串。 /// public static string Analyze_full_solution_on_background { get { @@ -88,7 +88,7 @@ public static string Analyze_full_solution_on_background { } /// - /// Looks up a localized string similar to Background analysis. + /// 查找类似 Background analysis 的本地化字符串。 /// public static string Background_analysis { get { @@ -97,7 +97,7 @@ public static string Background_analysis { } /// - /// Looks up a localized string similar to Block Structure Guides. + /// 查找类似 Block Structure Guides 的本地化字符串。 /// public static string Block_Structure { get { @@ -106,7 +106,7 @@ public static string Block_Structure { } /// - /// Looks up a localized string similar to Code Fixes. + /// 查找类似 Code Fixes 的本地化字符串。 /// public static string Code_Fixes { get { @@ -115,7 +115,7 @@ public static string Code_Fixes { } /// - /// Looks up a localized string similar to Completion Lists. + /// 查找类似 Completion Lists 的本地化字符串。 /// public static string Completion_Lists { get { @@ -124,7 +124,7 @@ public static string Completion_Lists { } /// - /// Looks up a localized string similar to D_ash underline. + /// 查找类似 D_ash underline 的本地化字符串。 /// public static string Dash_underline { get { @@ -133,7 +133,7 @@ public static string Dash_underline { } /// - /// Looks up a localized string similar to Diagnostics. + /// 查找类似 Diagnostics 的本地化字符串。 /// public static string Diagnostics { get { @@ -142,7 +142,7 @@ public static string Diagnostics { } /// - /// Looks up a localized string similar to D_ot underline. + /// 查找类似 D_ot underline 的本地化字符串。 /// public static string Dot_underline { get { @@ -151,7 +151,7 @@ public static string Dot_underline { } /// - /// Looks up a localized string similar to Keep background symbol keys. + /// 查找类似 Keep background symbol keys 的本地化字符串。 /// public static string Enable_Background_ItemKeyStore_And_Semantic_Classification { get { @@ -160,7 +160,7 @@ public static string Enable_Background_ItemKeyStore_And_Semantic_Classification } /// - /// Looks up a localized string similar to Enable fast find references & rename (experimental). + /// 查找类似 Enable fast find references & rename (experimental) 的本地化字符串。 /// public static string Enable_Fast_Find_References { get { @@ -169,7 +169,7 @@ public static string Enable_Fast_Find_References { } /// - /// Looks up a localized string similar to _Enable in-memory cross project references. + /// 查找类似 _Enable in-memory cross project references 的本地化字符串。 /// public static string Enable_in_memory_cross_project_references { get { @@ -178,7 +178,7 @@ public static string Enable_in_memory_cross_project_references { } /// - /// Looks up a localized string similar to Use live (unsaved) buffers for analysis (restart required). + /// 查找类似 Use live (unsaved) buffers for analysis (restart required) 的本地化字符串。 /// public static string Enable_Live_Buffers { get { @@ -187,7 +187,7 @@ public static string Enable_Live_Buffers { } /// - /// Looks up a localized string similar to Enable parallel reference resolution. + /// 查找类似 Enable parallel reference resolution 的本地化字符串。 /// public static string Enable_Parallel_Reference_Resolution { get { @@ -196,7 +196,7 @@ public static string Enable_Parallel_Reference_Resolution { } /// - /// Looks up a localized string similar to Enable partial type checking. + /// 查找类似 Enable partial type checking 的本地化字符串。 /// public static string Enable_partial_type_checking { get { @@ -205,7 +205,7 @@ public static string Enable_partial_type_checking { } /// - /// Looks up a localized string similar to Enable stale data for IntelliSense features. + /// 查找类似 Enable stale data for IntelliSense features 的本地化字符串。 /// public static string Enable_Stale_IntelliSense_Results { get { @@ -214,7 +214,7 @@ public static string Enable_Stale_IntelliSense_Results { } /// - /// Looks up a localized string similar to Always add new line on enter. + /// 查找类似 Always add new line on enter 的本地化字符串。 /// public static string Enter_key_always { get { @@ -223,7 +223,7 @@ public static string Enter_key_always { } /// - /// Looks up a localized string similar to Never add new line on enter. + /// 查找类似 Never add new line on enter 的本地化字符串。 /// public static string Enter_key_never { get { @@ -232,7 +232,7 @@ public static string Enter_key_never { } /// - /// Looks up a localized string similar to Only add new line on enter after end of fully typed word. + /// 查找类似 Only add new line on enter after end of fully typed word 的本地化字符串。 /// public static string Enter_key_only { get { @@ -241,7 +241,7 @@ public static string Enter_key_only { } /// - /// Looks up a localized string similar to Enter key behavior. + /// 查找类似 Enter key behavior 的本地化字符串。 /// public static string Enter_Key_Rule { get { @@ -250,7 +250,7 @@ public static string Enter_Key_Rule { } /// - /// Looks up a localized string similar to Find References Performance Options. + /// 查找类似 Find References Performance Options 的本地化字符串。 /// public static string Find_References_Performance { get { @@ -259,7 +259,7 @@ public static string Find_References_Performance { } /// - /// Looks up a localized string similar to Re-format indentation on paste (Experimental). + /// 查找类似 Re-format indentation on paste (Experimental) 的本地化字符串。 /// public static string Format_on_paste { get { @@ -268,7 +268,7 @@ public static string Format_on_paste { } /// - /// Looks up a localized string similar to Formatting. + /// 查找类似 Formatting 的本地化字符串。 /// public static string Formatting { get { @@ -277,7 +277,7 @@ public static string Formatting { } /// - /// Looks up a localized string similar to Inline Hints. + /// 查找类似 Inline Hints 的本地化字符串。 /// public static string Inline_Hints { get { @@ -286,7 +286,7 @@ public static string Inline_Hints { } /// - /// Looks up a localized string similar to IntelliSense Performance Options. + /// 查找类似 IntelliSense Performance Options 的本地化字符串。 /// public static string IntelliSense_Performance { get { @@ -295,7 +295,7 @@ public static string IntelliSense_Performance { } /// - /// Looks up a localized string similar to Keep all background intermediate resolutions (increases memory usage). + /// 查找类似 Keep all background intermediate resolutions (increases memory usage) 的本地化字符串。 /// public static string Keep_All_Background_Resolutions { get { @@ -304,7 +304,7 @@ public static string Keep_All_Background_Resolutions { } /// - /// Looks up a localized string similar to Keep all background symbol uses (increases memory usage). + /// 查找类似 Keep all background symbol uses (increases memory usage) 的本地化字符串。 /// public static string Keep_All_Background_Symbol_Uses { get { @@ -313,7 +313,7 @@ public static string Keep_All_Background_Symbol_Uses { } /// - /// Looks up a localized string similar to Performance. + /// 查找类似 Performance 的本地化字符串。 /// public static string Language_Service_Performance { get { @@ -322,7 +322,7 @@ public static string Language_Service_Performance { } /// - /// Looks up a localized string similar to Language service settings (advanced). + /// 查找类似 Language service settings (advanced) 的本地化字符串。 /// public static string Language_Service_Settings { get { @@ -331,7 +331,7 @@ public static string Language_Service_Settings { } /// - /// Looks up a localized string similar to Live Buffers. + /// 查找类似 Live Buffers 的本地化字符串。 /// public static string LiveBuffers { get { @@ -340,7 +340,7 @@ public static string LiveBuffers { } /// - /// Looks up a localized string similar to Navigation links. + /// 查找类似 Navigation links 的本地化字符串。 /// public static string Navigation_links { get { @@ -349,7 +349,7 @@ public static string Navigation_links { } /// - /// Looks up a localized string similar to Outlining. + /// 查找类似 Outlining 的本地化字符串。 /// public static string Outlining { get { @@ -358,7 +358,7 @@ public static string Outlining { } /// - /// Looks up a localized string similar to Parallelization (requires restart). + /// 查找类似 Parallelization (requires restart) 的本地化字符串。 /// public static string Parallelization { get { @@ -367,7 +367,7 @@ public static string Parallelization { } /// - /// Looks up a localized string similar to Preferred description width in characters. + /// 查找类似 Preferred description width in characters 的本地化字符串。 /// public static string Preferred_description_width_in_characters { get { @@ -376,7 +376,7 @@ public static string Preferred_description_width_in_characters { } /// - /// Looks up a localized string similar to F# Project and Caching Performance Options. + /// 查找类似 F# Project and Caching Performance Options 的本地化字符串。 /// public static string Project_Performance { get { @@ -385,7 +385,7 @@ public static string Project_Performance { } /// - /// Looks up a localized string similar to Remove unnecessary parentheses (experimental, might affect typing performance). + /// 查找类似 Remove unnecessary parentheses (experimental, might affect typing performance) 的本地化字符串。 /// public static string Remove_parens_code_fix { get { @@ -394,7 +394,7 @@ public static string Remove_parens_code_fix { } /// - /// Looks up a localized string similar to Send additional performance telemetry. + /// 查找类似 Send additional performance telemetry 的本地化字符串。 /// public static string Send_Additional_Telemetry { get { @@ -403,7 +403,7 @@ public static string Send_Additional_Telemetry { } /// - /// Looks up a localized string similar to Show s_ymbols in unopened namespaces. + /// 查找类似 Show s_ymbols in unopened namespaces 的本地化字符串。 /// public static string Show_all_symbols { get { @@ -412,7 +412,7 @@ public static string Show_all_symbols { } /// - /// Looks up a localized string similar to Show completion list after a character is _deleted. + /// 查找类似 Show completion list after a character is _deleted 的本地化字符串。 /// public static string Show_completion_list_after_a_character_is_deleted { get { @@ -421,7 +421,7 @@ public static string Show_completion_list_after_a_character_is_deleted { } /// - /// Looks up a localized string similar to _Show completion list after a character is typed. + /// 查找类似 _Show completion list after a character is typed 的本地化字符串。 /// public static string Show_completion_list_after_a_character_is_typed { get { @@ -430,7 +430,7 @@ public static string Show_completion_list_after_a_character_is_typed { } /// - /// Looks up a localized string similar to Show structure guidelines for F# code. + /// 查找类似 Show structure guidelines for F# code 的本地化字符串。 /// public static string Show_guides { get { @@ -439,7 +439,7 @@ public static string Show_guides { } /// - /// Looks up a localized string similar to Display inline parameter name hints (preview). + /// 查找类似 Display inline parameter name hints (preview) 的本地化字符串。 /// public static string Show_Inline_Parameter_Name_Hints { get { @@ -448,7 +448,7 @@ public static string Show_Inline_Parameter_Name_Hints { } /// - /// Looks up a localized string similar to Display inline type hints (preview). + /// 查找类似 Display inline type hints (preview) 的本地化字符串。 /// public static string Show_Inline_Type_Hints { get { @@ -457,7 +457,7 @@ public static string Show_Inline_Type_Hints { } /// - /// Looks up a localized string similar to S_how navigation links as. + /// 查找类似 S_how navigation links as 的本地化字符串。 /// public static string Show_navigation_links_as { get { @@ -466,7 +466,7 @@ public static string Show_navigation_links_as { } /// - /// Looks up a localized string similar to Show outlining and collapsible nodes for F# code. + /// 查找类似 Show outlining and collapsible nodes for F# code 的本地化字符串。 /// public static string Show_Outlining { get { @@ -475,7 +475,16 @@ public static string Show_Outlining { } /// - /// Looks up a localized string similar to Display return type hints (preview). + /// 查找类似 Show remarks in Quick Info 的本地化字符串。 + /// + public static string Show_remarks_in_Quick_Info { + get { + return ResourceManager.GetString("Show_remarks_in_Quick_Info", resourceCulture); + } + } + + /// + /// 查找类似 Display return type hints (preview) 的本地化字符串。 /// public static string Show_Return_Type_Hints { get { @@ -484,7 +493,7 @@ public static string Show_Return_Type_Hints { } /// - /// Looks up a localized string similar to Simplify names (remove unnecessary qualifiers). + /// 查找类似 Simplify names (remove unnecessary qualifiers) 的本地化字符串。 /// public static string Simplify_name_code_fix { get { @@ -493,7 +502,7 @@ public static string Simplify_name_code_fix { } /// - /// Looks up a localized string similar to _Solid underline. + /// 查找类似 _Solid underline 的本地化字符串。 /// public static string Solid_underline { get { @@ -502,7 +511,7 @@ public static string Solid_underline { } /// - /// Looks up a localized string similar to Suggest names for unresolved identifiers. + /// 查找类似 Suggest names for unresolved identifiers 的本地化字符串。 /// public static string Suggest_names_for_errors_code_fix { get { @@ -511,7 +520,7 @@ public static string Suggest_names_for_errors_code_fix { } /// - /// Looks up a localized string similar to Text hover. + /// 查找类似 Text hover 的本地化字符串。 /// public static string Text_hover { get { @@ -520,7 +529,7 @@ public static string Text_hover { } /// - /// Looks up a localized string similar to Time until stale results are used (in milliseconds). + /// 查找类似 Time until stale results are used (in milliseconds) 的本地化字符串。 /// public static string Time_until_stale_completion { get { @@ -529,7 +538,7 @@ public static string Time_until_stale_completion { } /// - /// Looks up a localized string similar to In-memory cross-project references store project-level data in memory to allow IDE features to work across projects.. + /// 查找类似 In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. 的本地化字符串。 /// public static string Tooltip_in_memory_cross_project_references { get { @@ -538,7 +547,7 @@ public static string Tooltip_in_memory_cross_project_references { } /// - /// Looks up a localized string similar to Format signature to the given width by adding line breaks conforming with F# syntax rules. . + /// 查找类似 Format signature to the given width by adding line breaks conforming with F# syntax rules. 的本地化字符串。 /// public static string Tooltip_preferred_description_width_in_characters { get { @@ -547,7 +556,7 @@ public static string Tooltip_preferred_description_width_in_characters { } /// - /// Looks up a localized string similar to Analyze and suggest fixes for unused values. + /// 查找类似 Analyze and suggest fixes for unused values 的本地化字符串。 /// public static string Unused_declaration_code_fix { get { @@ -556,7 +565,7 @@ public static string Unused_declaration_code_fix { } /// - /// Looks up a localized string similar to Remove unused open statements. + /// 查找类似 Remove unused open statements 的本地化字符串。 /// public static string Unused_opens_code_fix { get { @@ -565,7 +574,7 @@ public static string Unused_opens_code_fix { } /// - /// Looks up a localized string similar to Cache parsing results (experimental). + /// 查找类似 Cache parsing results (experimental) 的本地化字符串。 /// public static string Use_syntax_tree_cache { get { diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index b1362651cb3..7feb60ef6ae 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -288,4 +288,7 @@ Remove unnecessary parentheses (experimental, might affect typing performance) + + Show remarks in Quick Info + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index 4c1afb7bca0..189f7ab0d47 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -177,6 +177,11 @@ Zo_brazit navigační odkazy jako + + Show remarks in Quick Info + Show remarks in Quick Info + + Simplify names (remove unnecessary qualifiers) Zjednodušit názvy (odebrat nepotřebné kvalifikátory) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index f93c85b0afc..32aec995761 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -177,6 +177,11 @@ Navigationslink_s anzeigen als + + Show remarks in Quick Info + Show remarks in Quick Info + + Simplify names (remove unnecessary qualifiers) Namen vereinfachen (unnötige Qualifizierer entfernen) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 3b65a70284b..12f03e3d792 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -177,6 +177,11 @@ M_ostrar vínculos de navegación como + + Show remarks in Quick Info + Show remarks in Quick Info + + Simplify names (remove unnecessary qualifiers) Simplificar nombres (quitar calificadores innecesarios) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 1fcb58d38a5..2067c3e08fa 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -177,6 +177,11 @@ Affic_her les liens de navigation en tant que + + Show remarks in Quick Info + Show remarks in Quick Info + + Simplify names (remove unnecessary qualifiers) Simplifier les noms (supprimer les qualificateurs inutiles) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index ac84a49ac04..2a1ab80eabf 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -177,6 +177,11 @@ M_ostra collegamenti di navigazione come + + Show remarks in Quick Info + Show remarks in Quick Info + + Simplify names (remove unnecessary qualifiers) Semplifica nomi (rimuovi qualificatori non necessari) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 76036894dcb..baf5e88d30c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -177,6 +177,11 @@ 次としてナビゲーション リンクを表示する(_H) + + Show remarks in Quick Info + Show remarks in Quick Info + + Simplify names (remove unnecessary qualifiers) 名前の簡略化する (不要な修飾子の削除) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index f166bba08f3..5da24f5085f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -177,6 +177,11 @@ 탐색 링크를 다음으로 표시(_H) + + Show remarks in Quick Info + Show remarks in Quick Info + + Simplify names (remove unnecessary qualifiers) 이름 단순화(불필요한 한정자 제거) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index c4d70ab3a1f..5a91da868dd 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -177,6 +177,11 @@ P_okaż linki nawigacyjne jako + + Show remarks in Quick Info + Show remarks in Quick Info + + Simplify names (remove unnecessary qualifiers) Uprość nazwy (usuń niepotrzebne kwalifikatory) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index f1ef03e827e..6070faefdac 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -177,6 +177,11 @@ E_xibir link de navegação como + + Show remarks in Quick Info + Show remarks in Quick Info + + Simplify names (remove unnecessary qualifiers) Simplificar nomes (remover qualificadores desnecessários) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 4db5610e9bb..25fa5e80a5c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -177,6 +177,11 @@ П_оказать ссылки навигации как + + Show remarks in Quick Info + Show remarks in Quick Info + + Simplify names (remove unnecessary qualifiers) Упростить имена (удалить ненужные квалификаторы) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 95fa383de7e..2cd920230c9 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -177,6 +177,11 @@ Gezinti bağlantılarını farklı _göster + + Show remarks in Quick Info + Show remarks in Quick Info + + Simplify names (remove unnecessary qualifiers) Adları basitleştir (gereksiz niteleyicileri kaldır) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 3b45fdaf529..fefc112127e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -177,6 +177,11 @@ 导航链接显示方式(_H) + + Show remarks in Quick Info + Show remarks in Quick Info + + Simplify names (remove unnecessary qualifiers) 简化名称(删除不必要的限定符) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 50aede6ee96..099946ca6a7 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -177,6 +177,11 @@ 顯示導覽連結為(_H) + + Show remarks in Quick Info + Show remarks in Quick Info + + Simplify names (remove unnecessary qualifiers) 簡化名稱 (移除不必要的限定詞) From d6d7a39a4a1a183e97a7b0714af23797b5cfcaca Mon Sep 17 00:00:00 2001 From: ijklam Date: Sun, 10 Dec 2023 12:57:16 +0800 Subject: [PATCH 3/5] format code --- .../Completion/CompletionProvider.fs | 18 ++++++++++++++++-- .../FSharp.Editor/Completion/SignatureHelp.fs | 2 +- .../DocComments/XMLDocumentation.fs | 8 +++++++- .../QuickInfo/QuickInfoProvider.fs | 7 ++++++- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index 09fbc90af46..a18987ac48c 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -26,7 +26,12 @@ open CancellableTasks module Logger = Microsoft.VisualStudio.FSharp.Editor.Logger type internal FSharpCompletionProvider - (workspace: Workspace, serviceProvider: SVsServiceProvider, assemblyContentProvider: AssemblyContentProvider, editorOptions: EditorOptions) = + ( + workspace: Workspace, + serviceProvider: SVsServiceProvider, + assemblyContentProvider: AssemblyContentProvider, + editorOptions: EditorOptions + ) = inherit FSharpCompletionProviderBase() @@ -380,7 +385,16 @@ type internal FSharpCompletionProvider let documentation = List() let collector = RoslynHelpers.CollectTaggedText documentation // mix main description and xmldoc by using one collector - XmlDocumentation.BuildDataTipText(documentationBuilder, collector, collector, collector, collector, collector, description, editorOptions.QuickInfo.ShowRemarks) + XmlDocumentation.BuildDataTipText( + documentationBuilder, + collector, + collector, + collector, + collector, + collector, + description, + editorOptions.QuickInfo.ShowRemarks + ) Task.FromResult(CompletionDescription.Create(documentation.ToImmutableArray())) | _ -> diff --git a/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs b/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs index b877026000e..a6d9a50dd60 100644 --- a/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs +++ b/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs @@ -611,7 +611,7 @@ type internal FSharpSignatureHelpProvider [] (serviceProvi documentationBuilder: IDocumentationBuilder, caretPosition: int, triggerTypedChar: char option, - possibleCurrentSignatureHelpSessionKind: CurrentSignatureHelpSessionKind option, + possibleCurrentSignatureHelpSessionKind: CurrentSignatureHelpSessionKind option, editorOptions: EditorOptions ) = asyncMaybe { diff --git a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs index bd91c5f1212..b3228180ff2 100644 --- a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs +++ b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs @@ -448,7 +448,13 @@ module internal XmlDocumentation = OverLoadsLimit = 5 } - let BuildSingleTipText (documentationProvider: IDocumentationBuilder, dataTipElement: ToolTipElement, limits: LineLimits, showRemarks: bool) = + let BuildSingleTipText + ( + documentationProvider: IDocumentationBuilder, + dataTipElement: ToolTipElement, + limits: LineLimits, + showRemarks: bool + ) = let { LineLimit = lineLimit diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs index e93c6bad038..581a6a7fef3 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs @@ -31,7 +31,12 @@ type internal FSharpAsyncQuickInfoSource let getSingleContent (data: ToolTipElement) = let symbol, description, documentation = - XmlDocumentation.BuildSingleTipText(documentationBuilder, data, XmlDocumentation.DefaultLineLimits, editorOptions.QuickInfo.ShowRemarks) + XmlDocumentation.BuildSingleTipText( + documentationBuilder, + data, + XmlDocumentation.DefaultLineLimits, + editorOptions.QuickInfo.ShowRemarks + ) let getLinkTooltip filePath = let solutionDir = Path.GetDirectoryName(document.Project.Solution.FilePath) From b940c49b72325830fcc746edad20cf1af97dac8b Mon Sep 17 00:00:00 2001 From: ijklam Date: Sun, 10 Dec 2023 14:19:28 +0800 Subject: [PATCH 4/5] fix tests --- .../FSharp.Editor.Tests/QuickInfoTests.fs | 6 ++--- .../SignatureHelpProviderTests.fs | 22 +++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/vsintegration/tests/FSharp.Editor.Tests/QuickInfoTests.fs b/vsintegration/tests/FSharp.Editor.Tests/QuickInfoTests.fs index 083a25a07cf..8b24af5f117 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/QuickInfoTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/QuickInfoTests.fs @@ -50,12 +50,12 @@ module QuickInfo = | Some(ToolTipText elements) when not elements.IsEmpty -> let documentationBuilder = { new IDocumentationBuilder with - override _.AppendDocumentationFromProcessedXML(_, _, _, _, _, _) = () - override _.AppendDocumentation(_, _, _, _, _, _, _) = () + override _.AppendDocumentationFromProcessedXML(_, _, _, _, _, _, _) = () + override _.AppendDocumentation(_, _, _, _, _, _, _, _) = () } let _, mainDescription, docs = - XmlDocumentation.BuildSingleTipText(documentationBuilder, elements.Head, XmlDocumentation.DefaultLineLimits) + XmlDocumentation.BuildSingleTipText(documentationBuilder, elements.Head, XmlDocumentation.DefaultLineLimits, true) let mainTextItems = mainDescription |> Seq.map (fun x -> x.Text) let docTextItems = docs |> Seq.map (fun x -> x.Text) diff --git a/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs b/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs index d062f26a0bd..1432583da08 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs @@ -16,8 +16,8 @@ open Microsoft.VisualStudio.FSharp.Editor.CancellableTasks module SignatureHelpProvider = let private DefaultDocumentationProvider = { new IDocumentationBuilder with - override doc.AppendDocumentationFromProcessedXML(_, _, _, _, _, _) = () - override doc.AppendDocumentation(_, _, _, _, _, _, _) = () + override doc.AppendDocumentationFromProcessedXML(_, _, _, _, _, _, _) = () + override doc.AppendDocumentation(_, _, _, _, _, _, _, _) = () } let checker = FSharpChecker.Create() @@ -56,7 +56,8 @@ module SignatureHelpProvider = DefaultDocumentationProvider, sourceText, caretPosition, - triggerChar + triggerChar, + EditorOptions() ) |> Async.RunSynchronously @@ -102,7 +103,7 @@ module SignatureHelpProvider = let document = RoslynTestHelpers.CreateSolution(fileContents) |> RoslynTestHelpers.GetSingleDocument - + let parseResults, checkFileResults = document.GetFSharpParseAndCheckResultsAsync("assertSignatureHelpForMethodCalls") |> CancellableTask.runSynchronouslyWithoutCancellation @@ -123,7 +124,8 @@ module SignatureHelpProvider = DefaultDocumentationProvider, sourceText, caretPosition, - triggerChar + triggerChar, + EditorOptions() ) |> Async.RunSynchronously @@ -175,7 +177,8 @@ module SignatureHelpProvider = sourceText, caretPosition, adjustedColumnInSource, - filePath + filePath, + EditorOptions() ) |> Async.RunSynchronously @@ -440,8 +443,8 @@ type foo5 = N1.T module ``Function argument applications`` = let private DefaultDocumentationProvider = { new IDocumentationBuilder with - override doc.AppendDocumentationFromProcessedXML(_, _, _, _, _, _) = () - override doc.AppendDocumentation(_, _, _, _, _, _, _) = () + override doc.AppendDocumentationFromProcessedXML(_, _, _, _, _, _, _) = () + override doc.AppendDocumentation(_, _, _, _, _, _, _, _) = () } [] @@ -518,7 +521,8 @@ M.f sourceText, caretPosition, adjustedColumnInSource, - filePath + filePath, + EditorOptions() ) |> Async.RunSynchronously From c5612f313d2cc1c42c4662feca5ba1e8667e5f8e Mon Sep 17 00:00:00 2001 From: ijklam Date: Sun, 10 Dec 2023 14:28:44 +0800 Subject: [PATCH 5/5] format code --- .../tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs b/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs index 1432583da08..d4065f8a2b3 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs @@ -103,7 +103,7 @@ module SignatureHelpProvider = let document = RoslynTestHelpers.CreateSolution(fileContents) |> RoslynTestHelpers.GetSingleDocument - + let parseResults, checkFileResults = document.GetFSharpParseAndCheckResultsAsync("assertSignatureHelpForMethodCalls") |> CancellableTask.runSynchronouslyWithoutCancellation