@@ -3507,13 +3507,11 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso
35073507yield einfo.RemoveMethod.DisplayName]
35083508else []
35093509
3510- let suppressedMethNames = Zset.ofList String.order( pinfoMethNames@ einfoMethNames)
3511-
35123510let pinfos =
35133511 pinfosIncludingUnseen
35143512|> List.filter( fun x -> not ( PropInfoIsUnseen m x))
35153513
3516- let minfoFilter ( minfo : MethInfo ) =
3514+ let minfoFilter ( suppressedMethNames : Zset < _ >) ( minfo : MethInfo ) =
35173515let isApplicableMeth =
35183516match completionTargetswith
35193517| ResolveCompletionTargets.All x-> x
@@ -3574,45 +3572,55 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso
35743572// REVIEW: add a name filter here in the common cases?
35753573let minfos =
35763574if completionTargets.ResolveAllthen
3577- let minfos =
3578- AllMethInfosOfTypeInScope ncenv.InfoReader nenv( None, ad) PreferOverrides m ty
3579- |> List.filter minfoFilter
3580-
3581- let minfos =
3582- if isNil minfosthen [] else
3583- let addersAndRemovers =
3584- let hashSet = HashSet()
3585- for itemin pinfoItemsdo
3586- match itemwith
3587- | Item.Event( FSEvent(_,_, addValRef, removeValRef)) ->
3588- hashSet.Add addValRef.LogicalName|> ignore
3589- hashSet.Add removeValRef.LogicalName|> ignore
3590- | _ -> ()
3591- hashSet
3575+ let minfos = AllMethInfosOfTypeInScope ncenv.InfoReader nenv( None, ad) PreferOverrides m ty
3576+ if isNil minfosthen
3577+ []
3578+ else
3579+ let suppressedMethNames = Zset.ofList String.order( pinfoMethNames@ einfoMethNames)
35923580
3593- if addersAndRemovers.Count= 0 then minfos
3594- else minfos|> List.filter( fun minfo -> not ( addersAndRemovers.Contains minfo.LogicalName))
3581+ let minfos =
3582+ minfos
3583+ |> List.filter( minfoFilter suppressedMethNames)
3584+
3585+ if isNil minfosthen
3586+ []
3587+ else
3588+ let minfos =
3589+ let addersAndRemovers =
3590+ let hashSet = HashSet()
3591+ for itemin pinfoItemsdo
3592+ match itemwith
3593+ | Item.Event( FSEvent(_,_, addValRef, removeValRef)) ->
3594+ hashSet.Add addValRef.LogicalName|> ignore
3595+ hashSet.Add removeValRef.LogicalName|> ignore
3596+ | _ -> ()
3597+ hashSet
3598+
3599+ if addersAndRemovers.Count= 0 then minfos
3600+ else minfos|> List.filter( fun minfo -> not ( addersAndRemovers.Contains minfo.LogicalName))
35953601
35963602#if ! NO_ EXTENSIONTYPING
3597- // Filter out the ones with mangled names from applying static parameters
3598- let minfos =
3599- let methsWithStaticParams =
3600- minfos
3601- |> List.filter( fun minfo ->
3602- match minfo.ProvidedStaticParameterInfowith
3603- | Some(_ methBeforeArguments, staticParams) -> staticParams.Length<> 0
3604- | _ -> false )
3605- |> List.map( fun minfo -> minfo.DisplayName)
3606-
3607- if methsWithStaticParams.IsEmptythen minfos
3608- else minfos|> List.filter( fun minfo ->
3609- let nm = minfo.LogicalName
3610- not ( nm.Contains" ," && methsWithStaticParams|> List.exists( fun m -> nm.StartsWithOrdinal( m))))
3603+ // Filter out the ones with mangled names from applying static parameters
3604+ let minfos =
3605+ let methsWithStaticParams =
3606+ minfos
3607+ |> List.filter( fun minfo ->
3608+ match minfo.ProvidedStaticParameterInfowith
3609+ | Some(_ methBeforeArguments, staticParams) -> staticParams.Length<> 0
3610+ | _ -> false )
3611+ |> List.map( fun minfo -> minfo.DisplayName)
3612+
3613+ if methsWithStaticParams.IsEmptythen minfos
3614+ else minfos|> List.filter( fun minfo ->
3615+ let nm = minfo.LogicalName
3616+ not ( nm.Contains" ," && methsWithStaticParams|> List.exists( fun m -> nm.StartsWithOrdinal( m))))
36113617#endif
36123618
3613- minfos
3619+ minfos
3620+
3621+ else
3622+ []
36143623
3615- else []
36163624// Partition methods into overload sets
36173625let rec partitionl ( l : MethInfo list ) acc =
36183626match lwith
@@ -4185,13 +4193,12 @@ let ResolveCompletionsInTypeForItem (ncenv: NameResolver) nenv m ad statics ty (
41854193yield einfo.AddMethod.DisplayName
41864194yield einfo.RemoveMethod.DisplayName]
41874195
4188- let suppressedMethNames = Zset.ofList String.order( pinfoMethNames@ einfoMethNames)
41894196
41904197let pinfos =
41914198 pinfosIncludingUnseen
41924199|> List.filter( fun x -> not ( PropInfoIsUnseen m x))
41934200
4194- let minfoFilter ( minfo : MethInfo ) =
4201+ let minfoFilter ( suppressedMethNames : Zset < _ >) ( minfo : MethInfo ) =
41954202// Only show the Finalize, MemberwiseClose etc. methods on System.Object for values whose static type really is
41964203// System.Object. Few of these are typically used from F#.
41974204//
@@ -4242,37 +4249,49 @@ let ResolveCompletionsInTypeForItem (ncenv: NameResolver) nenv m ad statics ty (
42424249| Item.MethodGroup_ ->
42434250// REVIEW: add a name filter here in the common cases?
42444251let minfos =
4245- let minfos =
4246- AllMethInfosOfTypeInScope ncenv.InfoReader nenv ( None , ad ) PreferOverrides m ty
4247- |> List.filter minfoFilter
4248-
4252+ let minfos = AllMethInfosOfTypeInScope ncenv.InfoReader nenv ( None , ad ) PreferOverrides m ty
4253+ if isNil minfos then [] else
4254+
4255+ let suppressedMethNames = Zset.ofList String.order ( pinfoMethNames @ einfoMethNames )
42494256let minfos =
4250- let addersAndRemovers =
4251- pinfoItems
4252- |> List.collect( function Item.Event( FSEvent(_,_, addValRef, removeValRef)) -> [ addValRef.LogicalName; removeValRef.LogicalName] | _ -> [])
4253- |> set
4257+ minfos
4258+ |> List.filter( minfoFilter suppressedMethNames)
42544259
4255- if addersAndRemovers.IsEmptythen minfos
4256- else minfos|> List.filter( fun minfo -> not ( addersAndRemovers.Contains minfo.LogicalName))
4260+ if isNil minfosthen
4261+ []
4262+ else
4263+ let minfos =
4264+ let addersAndRemovers =
4265+ let hashSet = HashSet()
4266+ for itemin pinfoItemsdo
4267+ match itemwith
4268+ | Item.Event( FSEvent(_,_, addValRef, removeValRef)) ->
4269+ hashSet.Add addValRef.LogicalName|> ignore
4270+ hashSet.Add removeValRef.LogicalName|> ignore
4271+ | _ -> ()
4272+ hashSet
4273+
4274+ if addersAndRemovers.Count= 0 then minfos
4275+ else minfos|> List.filter( fun minfo -> not ( addersAndRemovers.Contains minfo.LogicalName))
42574276
42584277 #if ! NO_ EXTENSIONTYPING
4259- // Filter out the ones with mangled names from applying static parameters
4260- let minfos =
4261- let methsWithStaticParams =
4262- minfos
4263- |> List.filter( fun minfo ->
4264- match minfo.ProvidedStaticParameterInfowith
4265- | Some(_ methBeforeArguments, staticParams) -> staticParams.Length<> 0
4266- | _ -> false )
4267- |> List.map( fun minfo -> minfo.DisplayName)
4278+ // Filter out the ones with mangled names from applying static parameters
4279+ let minfos =
4280+ let methsWithStaticParams =
4281+ minfos
4282+ |> List.filter( fun minfo ->
4283+ match minfo.ProvidedStaticParameterInfowith
4284+ | Some(_ methBeforeArguments, staticParams) -> staticParams.Length<> 0
4285+ | _ -> false )
4286+ |> List.map( fun minfo -> minfo.DisplayName)
42684287
4269- if methsWithStaticParams.IsEmptythen minfos
4270- else minfos|> List.filter( fun minfo ->
4271- let nm = minfo.LogicalName
4272- not ( nm.Contains" ," && methsWithStaticParams|> List.exists( fun m -> nm.StartsWithOrdinal( m))))
4288+ if methsWithStaticParams.IsEmptythen minfos
4289+ else minfos|> List.filter( fun minfo ->
4290+ let nm = minfo.LogicalName
4291+ not ( nm.Contains" ," && methsWithStaticParams|> List.exists( fun m -> nm.StartsWithOrdinal( m))))
42734292 #endif
42744293
4275- minfos
4294+ minfos
42764295
42774296// Partition methods into overload sets
42784297let rec partitionl ( l : MethInfo list ) acc =