@@ -100,6 +100,7 @@ type internal IDocumentationBuilder =
100100 processedXml: string *
101101 showExceptions: bool *
102102 showParameters: bool *
103+ showRemarks: bool *
103104 paramName: string option ->
104105 unit
105106
@@ -111,6 +112,7 @@ type internal IDocumentationBuilder =
111112 signature: string *
112113 showExceptions: bool *
113114 showParameters: bool *
115+ showRemarks: bool *
114116 paramName: string option ->
115117 unit
116118
@@ -165,6 +167,7 @@ module internal XmlDocumentation =
165167 | " typeref" ->
166168 for attr in el.Attributes() do
167169 WriteAttribute collector attr " name" ( tagParameter >> collector.Add)
170+ | " br" -> AppendHardLine collector
168171 | _ -> WriteNodes collector ( el.Nodes())
169172 | _ -> ()
170173
@@ -210,13 +213,34 @@ module internal XmlDocumentation =
210213 with _ ->
211214 None
212215
213- member _.CollectSummary ( collector : ITaggedTextCollector ) =
216+ member _.CollectSummary ( collector : ITaggedTextCollector , showRemarks ) =
214217 match Seq.tryHead ( doc.Descendants( XName.op_ Implicit " summary" )) with
215218 | None -> ()
216219 | Some el ->
217220 EnsureHardLine collector
218221 WriteElement collector el
219222
223+ match Seq.tryHead ( doc.Descendants( XName.op_ Implicit " returns" )) with
224+ | None -> ()
225+ | Some el ->
226+ AppendHardLine collector
227+ AppendHardLine collector
228+ AppendOnNewLine collector ( SR.ReturnsHeader())
229+ AppendHardLine collector
230+ collector.Add( tagSpace " " )
231+ WriteElement collector el
232+
233+ if showRemarks then
234+ match Seq.tryHead ( doc.Descendants( XName.op_ Implicit " remarks" )) with
235+ | None -> ()
236+ | Some el ->
237+ AppendHardLine collector
238+ AppendHardLine collector
239+ AppendOnNewLine collector ( SR.RemarksHeader())
240+ AppendHardLine collector
241+ collector.Add( tagSpace " " )
242+ WriteElement collector el
243+
220244 member this.CollectParameter ( collector : ITaggedTextCollector , paramName : string ) =
221245 match tryFindParameter paramName with
222246 | None -> ()
@@ -294,11 +318,12 @@ module internal XmlDocumentation =
294318 exnCollector : ITaggedTextCollector ,
295319 xmlDocReader : XmlDocReader ,
296320 showExceptions ,
297- showParameters
321+ showParameters ,
322+ showRemarks
298323 ) =
299324 AppendHardLine xmlCollector
300325 xmlCollector.StartXMLDoc()
301- xmlDocReader.CollectSummary( xmlCollector)
326+ xmlDocReader.CollectSummary( xmlCollector, showRemarks )
302327
303328 if ( showParameters) then
304329 xmlDocReader.CollectParameters xmlCollector
@@ -315,13 +340,14 @@ module internal XmlDocumentation =
315340 processedXml ,
316341 showExceptions ,
317342 showParameters ,
343+ showRemarks ,
318344 paramName
319345 ) =
320346 match XmlDocReader.TryCreate processedXml with
321347 | Some xmlDocReader ->
322348 match paramName with
323349 | Some paramName -> xmlDocReader.CollectParameter( xmlCollector, paramName)
324- | None -> AppendMemberData( xmlCollector, exnCollector, xmlDocReader, showExceptions, showParameters)
350+ | None -> AppendMemberData( xmlCollector, exnCollector, xmlDocReader, showExceptions, showParameters, showRemarks )
325351 | None -> ()
326352
327353 /// Append Xml documentation contents into the StringBuilder
@@ -333,14 +359,15 @@ module internal XmlDocumentation =
333359 signature : string ,
334360 showExceptions : bool ,
335361 showParameters : bool ,
362+ showRemarks ,
336363 paramName : string option
337364 ) =
338365 try
339366 match GetMemberIndexOfAssembly( fileName) with
340367 | Some( index) ->
341- let _ , idx = index.ParseMemberSignature( signature)
368+ let ok , idx = index.ParseMemberSignature( signature)
342369
343- if idx <> 0 u then
370+ if Com.Succeeded ( ok ) then
344371 let ok , xml = index.GetMemberXML( idx)
345372
346373 if Com.Succeeded( ok) then
@@ -351,6 +378,7 @@ module internal XmlDocumentation =
351378 xml,
352379 showExceptions,
353380 showParameters,
381+ showRemarks,
354382 paramName
355383 )
356384 | None -> ()
@@ -367,6 +395,7 @@ module internal XmlDocumentation =
367395 xml ,
368396 showExceptions ,
369397 showParameters ,
398+ showRemarks ,
370399 paramName
371400 ) =
372401 match xml with
@@ -379,6 +408,7 @@ module internal XmlDocumentation =
379408 signature,
380409 showExceptions,
381410 showParameters,
411+ showRemarks,
382412 paramName
383413 )
384414 | FSharpXmlDoc.FromXmlText( xmlDoc) ->
@@ -391,6 +421,7 @@ module internal XmlDocumentation =
391421 processedXml,
392422 showExceptions,
393423 showParameters,
424+ showRemarks,
394425 paramName
395426 )
396427
@@ -417,7 +448,13 @@ module internal XmlDocumentation =
417448 OverLoadsLimit = 5
418449 }
419450
420- let BuildSingleTipText ( documentationProvider : IDocumentationBuilder , dataTipElement : ToolTipElement , limits : LineLimits ) =
451+ let BuildSingleTipText
452+ (
453+ documentationProvider : IDocumentationBuilder ,
454+ dataTipElement : ToolTipElement ,
455+ limits : LineLimits ,
456+ showRemarks : bool
457+ ) =
421458
422459 let {
423460 LineLimit = lineLimit
@@ -481,7 +518,7 @@ module internal XmlDocumentation =
481518 AppendHardLine usageCollector
482519 r |> Seq.iter usageCollector.Add)
483520
484- AppendXmlComment( documentationProvider, xmlCollector, exnCollector, item0.XmlDoc, true , false , item0.ParamName)
521+ AppendXmlComment( documentationProvider, xmlCollector, exnCollector, item0.XmlDoc, true , false , showRemarks , item0.ParamName)
485522
486523 ProcessGenericParameters item0.TypeMapping
487524
@@ -505,7 +542,8 @@ module internal XmlDocumentation =
505542 exnCollector ,
506543 showText ,
507544 showExceptions ,
508- showParameters
545+ showParameters ,
546+ showRemarks
509547 ) =
510548 let textCollector : ITaggedTextCollector =
511549 TextSanitizingCollector( textCollector, lineLimit = 45 ) :> _
@@ -590,6 +628,7 @@ module internal XmlDocumentation =
590628 item0.XmlDoc,
591629 showExceptions,
592630 showParameters,
631+ showRemarks,
593632 item0.ParamName
594633 )
595634
@@ -614,7 +653,8 @@ module internal XmlDocumentation =
614653 typeParameterMapCollector ,
615654 usageCollector ,
616655 exnCollector ,
617- ToolTipText ( dataTipText )
656+ ToolTipText ( dataTipText ),
657+ showRemarks
618658 ) =
619659 BuildTipText(
620660 documentationProvider,
@@ -626,10 +666,11 @@ module internal XmlDocumentation =
626666 exnCollector,
627667 true ,
628668 true ,
629- false
669+ false ,
670+ showRemarks
630671 )
631672
632- let BuildMethodOverloadTipText ( documentationProvider , textCollector , xmlCollector , ToolTipText ( dataTipText ), showParams ) =
673+ let BuildMethodOverloadTipText ( documentationProvider , textCollector , xmlCollector , ToolTipText ( dataTipText ), showParams , showRemarks ) =
633674 BuildTipText(
634675 documentationProvider,
635676 dataTipText,
@@ -640,17 +681,19 @@ module internal XmlDocumentation =
640681 ignore,
641682 false ,
642683 false ,
643- showParams
684+ showParams,
685+ showRemarks
644686 )
645687
646- let BuildMethodParamText ( documentationProvider , xmlCollector , xml , paramName ) =
688+ let BuildMethodParamText ( documentationProvider , xmlCollector , xml , paramName , showRemarks ) =
647689 AppendXmlComment(
648690 documentationProvider,
649691 TextSanitizingCollector( xmlCollector),
650692 TextSanitizingCollector( xmlCollector),
651693 xml,
652694 false ,
653695 true ,
696+ showRemarks,
654697 Some paramName
655698 )
656699
0 commit comments