@@ -218,6 +218,11 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) =
218218let isResolved () = not ( isUnresolved())
219219let checkIsResolved () = checkEntityIsResolved entity
220220
221+ let isDefinedInFSharpCore () =
222+ match ccuOfTyconRef entitywith
223+ | None-> false
224+ | Some ccu-> ccuEq ccu cenv.g.fslibCcu
225+
221226member __.Entity = entity
222227
223228member __.LogicalName =
@@ -520,16 +525,35 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) =
520525
521526member __.AllCompilationPaths =
522527 checkIsResolved()
523- let ( CompilationPath.CompPath ( _ , parts )) = entity.CompilationPath
524- ([], parts) ||> List.fold( fun res ( part , kind ) ->
525- let parts =
526- match kindwith
527- | ModuleOrNamespaceKind.FSharpModuleWithSuffix->
528- [ part; part.[.. part.Length- 7 ]]
529- | _ -> [ part]
530-
531- parts|> List.collect( fun part ->
532- res|> List.map( fun path -> path+ " ." + part)))
528+ let ( CompPath ( _ , parts )) = entity.CompilationPath
529+ let partsList =
530+ [ yield parts
531+ match partswith
532+ | ( " Microsoft" , ModuleOrNamespaceKind.Namespace) :: restwhen isDefinedInFSharpCore() -> yield rest
533+ | _ -> ()]
534+
535+ let mapEachCurrentPath ( paths : string list list ) path =
536+ match pathswith
537+ | [] -> [[ path]]
538+ | _ -> paths|> List.map( fun x -> path:: x)
539+
540+ let walkParts ( parts : ( string * ModuleOrNamespaceKind )list ) = //: string list list =
541+ let rec loop ( currentPaths : string list list ) parts =
542+ match partswith
543+ | [] -> currentPaths
544+ | ( name: string, kind) :: rest->
545+ match kindwith
546+ | ModuleOrNamespaceKind.FSharpModuleWithSuffix->
547+ [ yield ! loop( mapEachCurrentPath currentPaths name) rest
548+ yield ! loop( mapEachCurrentPath currentPaths( name.[.. name.Length- 7 ])) rest]
549+ | _ ->
550+ loop( mapEachCurrentPath currentPaths name) rest
551+ loop[] parts|> List.map( List.rev>> String.concat" ." )
552+
553+ let res =
554+ [ for partsin partsListdo
555+ yield ! walkParts parts]
556+ res
533557
534558override x.Equals ( other : obj ) =
535559 box x=== other||