@@ -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.
@@ -579,13 +577,11 @@ let CheckMethInfoAttributes g m tyargsOpt (minfo: MethInfo) =
579577/// Used to suppress the item in intellisense.
580578let MethInfoIsUnseen g ( m : range ) ( ty : TType ) minfo allowObsolete =
581579 let isUnseenByObsoleteAttrib () =
582- if allowObsolete then false else
583-
584580 match BindMethInfoAttributes m minfo
585- ( fun ilAttribs -> Some( CheckILAttributesForUnseen g ilAttribs m))
586- ( 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 ))
587583#if ! NO_ TYPEPROVIDERS
588- ( fun provAttribs -> Some( CheckProvidedAttributesForUnseen provAttribs m))
584+ ( fun provAttribs -> Some( not allowObsolete && CheckProvidedAttributesForUnseen provAttribs m))
589585#else
590586 ( fun _provAttribs -> None)
591587#endif
@@ -622,14 +618,14 @@ let MethInfoIsUnseen g (m: range) (ty: TType) minfo allowObsolete =
622618
623619/// Indicate if a property has 'Obsolete' or 'CompilerMessageAttribute'.
624620/// Used to suppress the item in intellisense.
625- let PropInfoIsUnseen m pinfo =
621+ let PropInfoIsUnseen m allowObsolete pinfo =
626622 match pinfo with
627623 | ILProp ( ILPropInfo(_, pdef) as ilpinfo) ->
628624 // Properties on .NET tuple types are resolvable but unseen
629625 isAnyTupleTy pinfo.TcGlobals ilpinfo.ILTypeInfo.ToType ||
630626 CheckILAttributesForUnseen pinfo.TcGlobals pdef.CustomAttrs m
631627 | FSProp ( g, _, Some vref, _)
632- | FSProp ( g, _, _, Some vref) -> CheckFSharpAttributesForUnseen g vref.Attribs m
628+ | FSProp ( g, _, _, Some vref) -> CheckFSharpAttributesForUnseen g vref.Attribs m allowObsolete
633629 | FSProp _ -> failwith " CheckPropInfoAttributes: unreachable"
634630#if ! NO_ TYPEPROVIDERS
635631 | ProvidedProp (_ amap, pi, m) ->
0 commit comments