@@ -1282,8 +1282,9 @@ module internal TypeFormatter =
12821282 n
12831283
12841284 curriedArgs
1285- |> List.map ( List.map ( fun x -> formatArgNameAndType ( counter ()) x |> fst))
1286- |> List.map ( fun argTuple ->
1285+ |> List.map ( fun args ->
1286+ let argTuple = args |> List.map ( formatArgNameAndType ( counter ()) >> fst)
1287+
12871288 match argTuple with
12881289 | [] -> !! " ()"
12891290 | [ argName ] when argName = " ()" -> !! " ()"
@@ -2217,10 +2218,9 @@ module internal SymbolReader =
22172218 }
22182219
22192220 /// Returns whether the link is not included in the document defined links
2220- let linkNotDefined ( doc : LiterateDocument ) ( link : string ) =
2221+ let linkDefined ( doc : LiterateDocument ) ( link : string ) =
22212222 [ link; link.Replace( " \r\n " , " " ); link.Replace( " \r\n " , " " ); link.Replace( " \n " , " " ); link.Replace( " \n " , " " ) ]
2222- |> Seq.map ( fun key -> not ( doc.DefinedLinks.ContainsKey( key)))
2223- |> Seq.reduce ( fun a c -> a && c)
2223+ |> List.exists ( fun key -> doc.DefinedLinks.ContainsKey( key))
22242224
22252225 /// Returns a tuple of the undefined link and its Cref if it exists
22262226 let getTypeLink ( ctx : ReadingContext ) undefinedLink =
@@ -2264,8 +2264,11 @@ module internal SymbolReader =
22642264 do
22652265 replacedParagraphs
22662266 |> Seq.collect collectParagraphIndirectLinks
2267- |> Seq.filter ( linkNotDefined doc)
2268- |> Seq.map ( getTypeLink ctx)
2267+ |> Seq.choose ( fun line ->
2268+ if linkDefined doc line then
2269+ None
2270+ else
2271+ getTypeLink ctx line |> Some)
22692272 |> Seq.iter ( addLinkToType doc)
22702273
22712274 doc.With( paragraphs = replacedParagraphs)
@@ -2275,15 +2278,12 @@ module internal SymbolReader =
22752278
22762279 let text =
22772280 lines
2278- |> List.filter (
2279- findCommand
2280- >> ( function
2281+ |> List.choose ( fun line ->
2282+ match findCommand line with
22812283 | Some( k, v) ->
22822284 cmds.[ k] <- v
2283- false
2284- | _ -> true )
2285- )
2286- |> List.map fst
2285+ None
2286+ | _ -> fst line |> Some)
22872287 |> String.concat " \n "
22882288
22892289 let doc =
@@ -2421,8 +2421,7 @@ module internal SymbolReader =
24212421
24222422 let readChildren ctx ( entities : FSharpEntity seq ) reader cond =
24232423 entities
2424- |> Seq.filter ( fun v -> checkAccess ctx v.Accessibility)
2425- |> Seq.filter cond
2424+ |> Seq.filter ( fun v -> checkAccess ctx v.Accessibility && cond v)
24262425 |> Seq.sortBy ( fun ( c : FSharpEntity ) -> c.DisplayName)
24272426 |> Seq.choose ( reader ctx)
24282427 |> List.ofSeq
@@ -2448,23 +2447,28 @@ module internal SymbolReader =
24482447
24492448 let readAllMembers ctx entityUrl kind ( members : FSharpMemberOrFunctionOrValue seq ) =
24502449 members
2451- |> Seq.filter ( fun v -> checkAccess ctx v.Accessibility)
2452- |> Seq.filter ( fun v ->
2453- not v.IsCompilerGenerated
2454- && not v.IsPropertyGetterMethod
2455- && not v.IsPropertySetterMethod
2456- && not v.IsEventAddMethod
2457- && not v.IsEventRemoveMethod)
2458- |> Seq.choose ( tryReadMember ctx entityUrl kind)
2450+ |> Seq.choose ( fun v ->
2451+ if
2452+ checkAccess ctx v.Accessibility
2453+ && not v.IsCompilerGenerated
2454+ && not v.IsPropertyGetterMethod
2455+ && not v.IsPropertySetterMethod
2456+ && not v.IsEventAddMethod
2457+ && not v.IsEventRemoveMethod
2458+ then
2459+ tryReadMember ctx entityUrl kind v
2460+ else
2461+ None)
24592462 |> List.ofSeq
24602463 |> collectNamespaceDocs
24612464
24622465 let readMembers ctx entityUrl kind ( entity : FSharpEntity ) cond =
24632466 entity.MembersFunctionsAndValues
2464- |> Seq.filter ( fun v -> checkAccess ctx v.Accessibility)
2465- |> Seq.filter ( fun v -> not v.IsCompilerGenerated)
2466- |> Seq.filter cond
2467- |> Seq.choose ( tryReadMember ctx entityUrl kind)
2467+ |> Seq.choose ( fun v ->
2468+ if checkAccess ctx v.Accessibility && not v.IsCompilerGenerated && cond v then
2469+ tryReadMember ctx entityUrl kind v
2470+ else
2471+ None)
24682472 |> List.ofSeq
24692473 |> collectNamespaceDocs
24702474
@@ -2485,47 +2489,51 @@ module internal SymbolReader =
24852489 let readUnionCases ctx entityUrl ( typ : FSharpEntity ) =
24862490 typ.UnionCases
24872491 |> List.ofSeq
2488- |> List.filter ( fun v -> checkAccess ctx v.Accessibility)
24892492 |> List.choose ( fun case ->
2490- readCommentsInto case ctx case.XmlDocSig ( fun cat catidx exclude _ comment ->
2491- let details = readUnionCase ctx typ case
2492-
2493- ApiDocMember(
2494- case.Name,
2495- readAttributes case.Attributes,
2496- entityUrl,
2497- ApiDocMemberKind.UnionCase,
2498- cat,
2499- catidx,
2500- exclude,
2501- details,
2502- comment,
2503- case,
2504- ctx.WarnOnMissingDocs
2505- )))
2493+ if checkAccess ctx case.Accessibility |> not then
2494+ None
2495+ else
2496+ readCommentsInto case ctx case.XmlDocSig ( fun cat catidx exclude _ comment ->
2497+ let details = readUnionCase ctx typ case
2498+
2499+ ApiDocMember(
2500+ case.Name,
2501+ readAttributes case.Attributes,
2502+ entityUrl,
2503+ ApiDocMemberKind.UnionCase,
2504+ cat,
2505+ catidx,
2506+ exclude,
2507+ details,
2508+ comment,
2509+ case,
2510+ ctx.WarnOnMissingDocs
2511+ )))
25062512 |> collectNamespaceDocs
25072513
25082514 let readRecordFields ctx entityUrl ( typ : FSharpEntity ) =
25092515 typ.FSharpFields
25102516 |> List.ofSeq
2511- |> List.filter ( fun field -> not field.IsCompilerGenerated)
25122517 |> List.choose ( fun field ->
2513- readCommentsInto field ctx field.XmlDocSig ( fun cat catidx exclude _ comment ->
2514- let details = readFSharpField ctx field
2515-
2516- ApiDocMember(
2517- field.Name,
2518- readAttributes ( Seq.append field.FieldAttributes field.PropertyAttributes),
2519- entityUrl,
2520- ApiDocMemberKind.RecordField,
2521- cat,
2522- catidx,
2523- exclude,
2524- details,
2525- comment,
2526- field,
2527- ctx.WarnOnMissingDocs
2528- )))
2518+ if field.IsCompilerGenerated then
2519+ None
2520+ else
2521+ readCommentsInto field ctx field.XmlDocSig ( fun cat catidx exclude _ comment ->
2522+ let details = readFSharpField ctx field
2523+
2524+ ApiDocMember(
2525+ field.Name,
2526+ readAttributes ( Seq.append field.FieldAttributes field.PropertyAttributes),
2527+ entityUrl,
2528+ ApiDocMemberKind.RecordField,
2529+ cat,
2530+ catidx,
2531+ exclude,
2532+ details,
2533+ comment,
2534+ field,
2535+ ctx.WarnOnMissingDocs
2536+ )))
25292537 |> collectNamespaceDocs
25302538
25312539 let readStaticParams ctx entityUrl ( typ : FSharpEntity ) =
@@ -2585,11 +2593,12 @@ module internal SymbolReader =
25852593 if isNull nameAttr then
25862594 None
25872595 else
2588- Some( nameAttr.Value, p.Value))
2589- |> Seq.iter ( fun ( name , xmlDoc ) ->
2590- let xmlDocSig = getFSharpStaticParamXmlSig typ name
2596+ let xmlDocSig = getFSharpStaticParamXmlSig typ nameAttr.Value
25912597
2592- registerXmlDoc ctx xmlDocSig ( Security.SecurityElement.Escape xmlDoc) |> ignore)
2598+ registerXmlDoc ctx xmlDocSig ( Security.SecurityElement.Escape p.Value)
2599+ |> ignore
2600+ |> Some)
2601+ |> ignore
25932602
25942603 let rec readType ( ctx : ReadingContext ) ( typ : FSharpEntity ) =
25952604 if typ.IsProvided && typ.XmlDoc <> FSharpXmlDoc.None then
@@ -2617,17 +2626,15 @@ module internal SymbolReader =
26172626
26182627 let ivals , svals =
26192628 getMembers typ
2620- |> List.ofSeq
2621- |> List.filter ( fun v ->
2629+ |> Seq.filter ( fun v ->
26222630 checkAccess ctx v.Accessibility
26232631 && not v.IsCompilerGenerated
2624- && not v.IsOverrideOrExplicitInterfaceImplementation)
2625- |> List.filter ( fun v ->
2626- not v.IsCompilerGenerated
2632+ && not v.IsOverrideOrExplicitInterfaceImplementation
26272633 && not v.IsEventAddMethod
26282634 && not v.IsEventRemoveMethod
26292635 && not v.IsPropertyGetterMethod
26302636 && not v.IsPropertySetterMethod)
2637+ |> List.ofSeq
26312638 |> List.partition ( fun v -> v.IsInstanceMember)
26322639
26332640 let cvals , svals = svals |> List.partition ( fun v -> v.CompiledName = " .ctor" )
0 commit comments