@@ -563,6 +563,9 @@ type EntityOptionalData =
563563 // MUTABILITY: only for unpickle linkage
564564 mutable entity_xmldoc: XmlDoc
565565
566+ /// the signature xml doc for an item in an implementation file.
567+ mutable entity_other_xmldoc : XmlDoc option
568+
566569 /// The XML document signature for this entity
567570 mutable entity_xmldocsig: string
568571
@@ -651,7 +654,8 @@ type Entity =
651654 { entity_ compiled_ name = None
652655 entity_ other_ range = None
653656 entity_ kind = TyparKind.Type
654- entity_ xmldoc = XmlDoc.Empty
657+ entity_ xmldoc = XmlDoc.Empty
658+ entity_ other_ xmldoc = None
655659 entity_ xmldocsig = " "
656660 entity_ tycon_ abbrev = None
657661 entity_ tycon_ repr_ accessibility = TAccess []
@@ -764,6 +768,11 @@ type Entity =
764768 match x.entity_ opt_ data with
765769 | Some optData -> optData.entity_ other_ range <- Some m
766770 | _ -> x.entity_ opt_ data <- Some { Entity.NewEmptyEntityOptData() with entity_ other_ range = Some m }
771+
772+ member x.SetOtherXmlDoc xmlDoc =
773+ match x.entity_ opt_ data with
774+ | Some optData -> optData.entity_ other_ xmldoc <- Some xmlDoc
775+ | _ -> x.entity_ opt_ data <- Some { Entity.NewEmptyEntityOptData() with entity_ other_ xmldoc = Some xmlDoc }
767776
768777 /// A unique stamp for this module, namespace or type definition within the context of this compilation.
769778 /// Note that because of signatures, there are situations where in a single compilation the "same"
@@ -787,7 +796,13 @@ type Entity =
787796 | _ ->
788797#endif
789798 match x.entity_ opt_ data with
790- | Some optData -> optData.entity_ xmldoc
799+ | Some optData ->
800+ if not optData.entity_ xmldoc.IsEmpty then
801+ optData.entity_ xmldoc
802+ else
803+ match optData.entity_ other_ xmldoc with
804+ | Some xmlDoc -> xmlDoc
805+ | None -> XmlDoc.Empty
791806 | _ -> XmlDoc.Empty
792807
793808 /// The XML documentation sig-string of the entity, if any, to use to lookup an .xml doc file. This also acts
@@ -1046,6 +1061,7 @@ type Entity =
10461061 entity_ kind = tg.entity_ kind
10471062 entity_ xmldoc = tg.entity_ xmldoc
10481063 entity_ xmldocsig = tg.entity_ xmldocsig
1064+ entity_ other_ xmldoc = tg.entity_ other_ xmldoc
10491065 entity_ tycon_ abbrev = tg.entity_ tycon_ abbrev
10501066 entity_ tycon_ repr_ accessibility = tg.entity_ tycon_ repr_ accessibility
10511067 entity_ accessibility = tg.entity_ accessibility
@@ -1659,7 +1675,10 @@ type UnionCase =
16591675 ReturnType: TType
16601676
16611677 /// Documentation for the case
1662- XmlDoc: XmlDoc
1678+ OwnXmlDoc: XmlDoc
1679+
1680+ /// Documentation for the case from signature file
1681+ mutable OtherXmlDoc: XmlDoc
16631682
16641683 /// XML documentation signature for the case
16651684 mutable XmlDocSig: string
@@ -1679,7 +1698,14 @@ type UnionCase =
16791698 // MUTABILITY: used when propagating signature attributes into the implementation.
16801699 mutable Attribs: Attribs
16811700 }
1682-
1701+
1702+ /// Documentation for the case
1703+ member uc.XmlDoc : XmlDoc =
1704+ if not uc.OwnXmlDoc.IsEmpty then
1705+ uc.OwnXmlDoc
1706+ else
1707+ uc.OtherXmlDoc
1708+
16831709 /// Get the declaration location of the union case
16841710 member uc.Range = uc.Id.idRange
16851711
@@ -1695,6 +1721,9 @@ type UnionCase =
16951721 | Some ( m, false ) -> m
16961722 | _ -> uc.Range
16971723
1724+ member x.SetOtherXmlDoc xmlDoc =
1725+ x.OtherXmlDoc <- xmlDoc
1726+
16981727 /// Get the logical name of the union case
16991728 member uc.LogicalName = uc.Id.idText
17001729
@@ -1751,6 +1780,9 @@ type RecdField =
17511780
17521781 /// Documentation for the field
17531782 rfield_xmldoc: XmlDoc
1783+
1784+ /// Documentation for the field from signature file
1785+ mutable rfield_otherxmldoc: XmlDoc
17541786
17551787 /// XML Documentation signature for the field
17561788 mutable rfield_xmldocsig: string
@@ -1843,7 +1875,14 @@ type RecdField =
18431875 member v.FormalType = v.rfield_ type
18441876
18451877 /// XML Documentation signature for the field
1846- member v.XmlDoc = v.rfield_ xmldoc
1878+ member v.XmlDoc =
1879+ if not v.rfield_ xmldoc.IsEmpty then
1880+ v.rfield_ xmldoc
1881+ else
1882+ v.rfield_ otherxmldoc
1883+
1884+ member v.SetOtherXmlDoc ( xmlDoc : XmlDoc ) =
1885+ v.rfield_ otherxmldoc <- xmlDoc
18471886
18481887 /// Get or set the XML documentation signature for the field
18491888 member v.XmlDocSig
@@ -3491,7 +3530,15 @@ type EntityRef =
34913530 /// then this _does_ include this documentation. If the entity is backed by Abstract IL metadata
34923531 /// or comes from another F# assembly then it does not (because the documentation will get read from
34933532 /// an XML file).
3494- member x.XmlDoc = x.Deref.XmlDoc
3533+ member x.XmlDoc =
3534+ if not ( x.Deref.XmlDoc.IsEmpty) then
3535+ x.Deref.XmlDoc
3536+ else
3537+ x.Deref.entity_ opt_ data
3538+ |> Option.bind ( fun d -> d.entity_ other_ xmldoc)
3539+ |> Option.defaultValue XmlDoc.Empty
3540+
3541+ member x.SetOtherXmlDoc ( xmlDoc : XmlDoc ) = x.Deref.SetOtherXmlDoc( xmlDoc)
34953542
34963543 /// The XML documentation sig-string of the entity, if any, to use to lookup an .xml doc file. This also acts
34973544 /// as a cache for this sig-string computation.
@@ -5844,7 +5891,8 @@ type Construct() =
58445891 /// Create a new union case node
58455892 static member NewUnionCase id tys retTy attribs docOption access : UnionCase =
58465893 { Id = id
5847- XmlDoc = docOption
5894+ OwnXmlDoc = docOption
5895+ OtherXmlDoc = XmlDoc.Empty
58485896 XmlDocSig = " "
58495897 Accessibility = access
58505898 FieldTable = Construct.MakeRecdFieldsTable tys
@@ -5883,7 +5931,8 @@ type Construct() =
58835931 rfield_ const = konst
58845932 rfield_ access = access
58855933 rfield_ secret = secret
5886- rfield_ xmldoc = docOption
5934+ rfield_ xmldoc = docOption
5935+ rfield_ otherxmldoc = XmlDoc.Empty
58875936 rfield_ xmldocsig = " "
58885937 rfield_ id = id
58895938 rfield_ name_ generated = nameGenerated
0 commit comments