@@ -197,6 +197,12 @@ type EntityKind =
197197| Moduleof ModuleKind
198198override x.ToString () = sprintf" %A " x
199199
200+ [<RequireQualifiedAccess>]
201+ type LookupType =
202+ | Fuzzy
203+ | Precise
204+
205+ [<NoComparison; NoEquality>]
200206type RawEntity =
201207{ /// Full entity name as it's seen in compiled code (raw FSharpEntity.FullName, FSharpValueOrFunction.FullName).
202208 FullName: string
@@ -208,7 +214,7 @@ type RawEntity =
208214 IsPublic: bool
209215 TopRequireQualifiedAccessParent: Idents option
210216 AutoOpenParent: Idents option
211- Kind: EntityKind }
217+ Kind: LookupType -> EntityKind}
212218override x.ToString () = sprintf" %A " x
213219
214220type AssemblyPath = string
@@ -271,27 +277,10 @@ module internal TypedAstPatterns =
271277if ty.HasTypeDefinitionthen Some ty.TypeDefinition
272278else None
273279
274- // todo FSharpEntity.BaseType causes uncatchable error dialog in debug mode, it does not allow to test VFT at all.
275-
276- //let (|Attribute|_|) (entity: FSharpEntity) =
277- // let isAttribute (entity: FSharpEntity) =
278- // let getBaseType (entity: FSharpEntity) =
279- // try
280- // match entity.BaseType with
281- // | Some (TypeWithDefinition def) -> Some def
282- // | _ -> None
283- // with _ -> None
284-
285- // let rec isAttributeType (ty: FSharpEntity option) =
286- // match ty with
287- // | None -> false
288- // | Some ty ->
289- // match ty.TryGetFullName() with
290- // | None -> false
291- // | Some fullName ->
292- // fullName = "System.Attribute" || isAttributeType (getBaseType ty)
293- // isAttributeType (Some entity)
294- // if isAttribute entity then Some() else None
280+ let (| Attribute | _ |) ( entity : FSharpEntity ) =
281+ let isAttribute ( entity : FSharpEntity ) =
282+ try entity.IsAttributeTypewith _ -> false
283+ if isAttribute entitythen Some() else None
295284
296285let (| FSharpModule | _ |) ( entity : FSharpEntity ) = if entity.IsFSharpModulethen Some() else None
297286
@@ -317,15 +306,19 @@ module internal AssemblyContentProvider =
317306 IsPublic= entity.Accessibility.IsPublic
318307 TopRequireQualifiedAccessParent= parent.RequiresQualifiedAccess|> Option.map parent.FixParentModuleSuffix
319308 AutoOpenParent= parent.AutoOpen|> Option.map parent.FixParentModuleSuffix
320- Kind=
321- match entitywith
322- // see comment above about BaseType
323- //| TypedAstPatterns.Attribute -> EntityKind.Attribute
324- | TypedAstPatterns.FSharpModule->
309+ Kind= fun lookupType ->
310+ match entity, lookupTypewith
311+ | TypedAstPatterns.FSharpModule, _ ->
325312 EntityKind.Module
326313{ IsAutoOpen= hasAttribute< AutoOpenAttribute> entity.Attributes
327314 HasModuleSuffix= hasModuleSuffixAttribute entity}
328- | _ -> EntityKind.Type})
315+ | _, LookupType.Fuzzy->
316+ EntityKind.Type
317+ | _, LookupType.Precise->
318+ match entitywith
319+ | TypedAstPatterns.Attribute-> EntityKind.Attribute
320+ | _ -> EntityKind.Type
321+ })
329322
330323let private traverseMemberFunctionAndValues ns ( parent : Parent ) ( membersFunctionsAndValues : seq < FSharpMemberOrFunctionOrValue >) =
331324 membersFunctionsAndValues
@@ -338,7 +331,7 @@ module internal AssemblyContentProvider =
338331 TopRequireQualifiedAccessParent=
339332 parent.RequiresQualifiedAccess|> Option.map parent.FixParentModuleSuffix
340333 AutoOpenParent= parent.AutoOpen|> Option.map parent.FixParentModuleSuffix
341- Kind= EntityKind.FunctionOrValue func.IsActivePattern}
334+ Kind= fun _ -> EntityKind.FunctionOrValue func.IsActivePattern}
342335
343336[ yield ! func.TryGetFullDisplayName()
344337|> Option.map( fun fullDisplayName -> processIdents func.FullName( fullDisplayName.Split'.' ))
@@ -373,7 +366,7 @@ module internal AssemblyContentProvider =
373366{ RequiresQualifiedAccess=
374367 parent.RequiresQualifiedAccess
375368|> Option.orElse(
376- if hasAttribute< RequireQualifiedAccessAttribute> entity.Attributesthen
369+ if entity.IsFSharp && hasAttribute< RequireQualifiedAccessAttribute> entity.Attributesthen
377370 parent.FormatEntityFullName entity|> Option.map snd
378371else None)
379372 AutoOpen=
@@ -405,7 +398,7 @@ module internal AssemblyContentProvider =
405398let getAssemblySignatureContent contentType ( signature : FSharpAssemblySignature ) =
406399 signature.TryGetEntities()
407400|> Seq.collect( traverseEntity contentType Parent.Empty)
408- |> Seq.distinct
401+ |> Seq.distinctBy ( fun { FullName = fullName ; CleanedIdents = cleanIdents } -> ( fullName , cleanIdents ))
409402
410403let private getAssemblySignaturesContent contentType ( assemblies : FSharpAssembly list ) =
411404 assemblies