@@ -478,13 +478,11 @@ let CheckFSharpAttributesForObsolete (g:TcGlobals) attribs =
478478 // like Span and ReadOnlySpan in completion lists due to their dual attributes.
479479 not ( HasFSharpAttributeOpt g g.attrib_ IsByRefLikeAttribute_ opt attribs)
480480
481- /// Indicate if a list of F# attributes contains 'ObsoleteAttribute'. Used to suppress the item in intellisense.
482- /// Also check the attributes for CompilerMessageAttribute, which has an IsHidden argument that allows
483- /// items to be suppressed from intellisense.
484- let CheckFSharpAttributesForUnseen g attribs _m =
481+ /// Indicates if a list of F# attributes contains 'ObsoleteAttribute' or CompilerMessageAttribute', which has an IsHidden argument
482+ /// May be used to suppress items from intellisense.
483+ let CheckFSharpAttributesForUnseen g attribs _m allowObsolete =
485484 not ( isNil attribs) &&
486- ( CheckFSharpAttributesForObsolete g attribs ||
487- CheckFSharpAttributesForHidden g attribs)
485+ ( not allowObsolete && CheckFSharpAttributesForObsolete g attribs || CheckFSharpAttributesForHidden g attribs)
488486
489487#if ! NO_ TYPEPROVIDERS
490488/// Indicate if a list of provided attributes contains 'ObsoleteAttribute'. Used to suppress the item in intellisense.
@@ -577,13 +575,13 @@ let CheckMethInfoAttributes g m tyargsOpt (minfo: MethInfo) =
577575
578576/// Indicate if a method has 'Obsolete', 'CompilerMessageAttribute' or 'TypeProviderEditorHideMethodsAttribute'.
579577/// Used to suppress the item in intellisense.
580- let MethInfoIsUnseen g ( m : range ) ( ty : TType ) minfo =
581- let isUnseenByObsoleteAttrib () =
578+ let MethInfoIsUnseen g ( m : range ) ( ty : TType ) minfo allowObsolete =
579+ let isUnseenByObsoleteAttrib () =
582580 match BindMethInfoAttributes m minfo
583- ( fun ilAttribs -> Some( CheckILAttributesForUnseen g ilAttribs m))
584- ( fun fsAttribs -> Some( CheckFSharpAttributesForUnseen g fsAttribs m))
581+ ( fun ilAttribs -> Some( not allowObsolete && CheckILAttributesForUnseen g ilAttribs m))
582+ ( fun fsAttribs -> Some( CheckFSharpAttributesForUnseen g fsAttribs m allowObsolete ))
585583#if ! NO_ TYPEPROVIDERS
586- ( fun provAttribs -> Some( CheckProvidedAttributesForUnseen provAttribs m))
584+ ( fun provAttribs -> Some( not allowObsolete && CheckProvidedAttributesForUnseen provAttribs m))
587585#else
588586 ( fun _provAttribs -> None)
589587#endif
@@ -620,14 +618,14 @@ let MethInfoIsUnseen g (m: range) (ty: TType) minfo =
620618
621619/// Indicate if a property has 'Obsolete' or 'CompilerMessageAttribute'.
622620/// Used to suppress the item in intellisense.
623- let PropInfoIsUnseen m pinfo =
621+ let PropInfoIsUnseen m allowObsolete pinfo =
624622 match pinfo with
625623 | ILProp ( ILPropInfo(_, pdef) as ilpinfo) ->
626624 // Properties on .NET tuple types are resolvable but unseen
627625 isAnyTupleTy pinfo.TcGlobals ilpinfo.ILTypeInfo.ToType ||
628626 CheckILAttributesForUnseen pinfo.TcGlobals pdef.CustomAttrs m
629627 | FSProp ( g, _, Some vref, _)
630- | FSProp ( g, _, _, Some vref) -> CheckFSharpAttributesForUnseen g vref.Attribs m
628+ | FSProp ( g, _, _, Some vref) -> CheckFSharpAttributesForUnseen g vref.Attribs m allowObsolete
631629 | FSProp _ -> failwith " CheckPropInfoAttributes: unreachable"
632630#if ! NO_ TYPEPROVIDERS
633631 | ProvidedProp (_ amap, pi, m) ->
0 commit comments