diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index cb0dc5478ee..a4684decb63 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -1378,28 +1378,6 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.GetNativeProbingRoots() = data.GetNativeProbingRoots() - /// A closed set of assemblies where, for any subset S: - /// - the TcImports object built for S (and thus the F# Compiler CCUs for the assemblies in S) - /// is a resource that can be shared between any two IncrementalBuild objects that reference - /// precisely S - /// - /// Determined by looking at the set of assemblies referenced by f# . - /// - /// Returning true may mean that the file is locked and/or placed into the - /// 'framework' reference set that is potentially shared across multiple compilations. - member tcConfig.IsSystemAssembly(fileName: string) = - try - FileSystem.FileExistsShim fileName - && ((tcConfig.GetTargetFrameworkDirectories() - |> List.exists (fun clrRoot -> clrRoot = Path.GetDirectoryName fileName)) - || (tcConfig - .FxResolver - .GetSystemAssemblies() - .Contains(FileSystemUtils.fileNameWithoutExtension fileName)) - || tcConfig.FxResolver.IsInReferenceAssemblyPackDirectory fileName) - with _ -> - false - member tcConfig.GenerateSignatureData = not tcConfig.standalone && not tcConfig.noSignatureData diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index 034e514d3c2..b427ded141f 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -819,8 +819,6 @@ type TcConfig = member GetSearchPathsForLibraryFiles: unit -> string list - member IsSystemAssembly: string -> bool - member PrimaryAssemblyDllReference: unit -> AssemblyReference member CoreLibraryDllReference: unit -> AssemblyReference diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index b7738705788..acc4000278d 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -276,15 +276,11 @@ type AssemblyResolution = /// Create the tooltip text for the assembly reference prepareToolTip: unit -> string - /// Whether or not this is an installed system assembly (for example, System.dll) - sysdir: bool - /// Lazily populated ilAssemblyRef for this reference. mutable ilAssemblyRef: ILAssemblyRef option } - override this.ToString() = - sprintf "%s%s" (if this.sysdir then "[sys]" else "") this.resolvedPath + override this.ToString() = this.resolvedPath member this.ProjectReference = this.originalReference.ProjectReference @@ -387,15 +383,11 @@ type TcConfig with // See if the language service has already produced the contents of the assembly for us, virtually match r.ProjectReference with | Some _ -> - let resolved = r.Text - let sysdir = tcConfig.IsSystemAssembly resolved - Some { originalReference = r - resolvedPath = resolved - prepareToolTip = (fun () -> resolved) - sysdir = sysdir + resolvedPath = r.Text + prepareToolTip = (fun () -> r.Text) ilAssemblyRef = None } | None -> @@ -416,8 +408,6 @@ type TcConfig with match resolved with | Some resolved -> - let sysdir = tcConfig.IsSystemAssembly resolved - Some { originalReference = r @@ -427,7 +417,6 @@ type TcConfig with let fusionName = AssemblyName.GetAssemblyName(resolved).ToString() let line (append: string) = append.Trim(' ') + "\n" line resolved + line fusionName) - sysdir = sysdir ilAssemblyRef = None } | None -> None @@ -564,7 +553,6 @@ type TcConfig with originalReference = originalReference resolvedPath = canonicalItemSpec prepareToolTip = (fun () -> resolvedFile.prepareToolTip (originalReference.Text, canonicalItemSpec)) - sysdir = tcConfig.IsSystemAssembly canonicalItemSpec ilAssemblyRef = None } ] @@ -751,63 +739,15 @@ type TcAssemblyResolutions(tcConfig: TcConfig, results: AssemblyResolution list, yield! tcConfig.referencedDLLs ] - static member SplitNonFoundationalResolutions(tcConfig: TcConfig) = + static member ResolveAssemblyReferences(tcConfig: TcConfig) = let assemblyList = TcAssemblyResolutions.GetAllDllReferences tcConfig - let resolutions = - TcAssemblyResolutions.ResolveAssemblyReferences(tcConfig, assemblyList, tcConfig.knownUnresolvedReferences) - - let frameworkDLLs, nonFrameworkReferences = - resolutions.GetAssemblyResolutions() |> List.partition (fun r -> r.sysdir) - - let unresolved = resolutions.GetUnresolvedReferences() -#if DEBUG - let mutable itFailed = false - - let addedText = - "\nIf you want to debug this right now, attach a debugger, and put a breakpoint in 'CompileOps.fs' near the text '!itFailed', and you can re-step through the assembly resolution logic." - - for UnresolvedAssemblyReference (referenceText, _ranges) in unresolved do - if referenceText.Contains("mscorlib") then - Debug.Assert(false, sprintf "whoops, did not resolve mscorlib: '%s'%s" referenceText addedText) - itFailed <- true - - for x in frameworkDLLs do - if not (FileSystem.IsPathRootedShim(x.resolvedPath)) then - Debug.Assert(false, sprintf "frameworkDLL should be absolute path: '%s'%s" x.resolvedPath addedText) - itFailed <- true - - for x in nonFrameworkReferences do - if not (FileSystem.IsPathRootedShim(x.resolvedPath)) then - Debug.Assert(false, sprintf "nonFrameworkReference should be absolute path: '%s'%s" x.resolvedPath addedText) - itFailed <- true - - if itFailed then - // idea is, put a breakpoint here and then step through - let assemblyList = TcAssemblyResolutions.GetAllDllReferences tcConfig - - let resolutions = - TcAssemblyResolutions.ResolveAssemblyReferences(tcConfig, assemblyList, []) - - let _frameworkDLLs, _nonFrameworkReferences = - resolutions.GetAssemblyResolutions() |> List.partition (fun r -> r.sysdir) - - () -#endif - frameworkDLLs, nonFrameworkReferences, unresolved - - static member BuildFromPriorResolutions(tcConfig: TcConfig, resolutions, knownUnresolved) = - let references = resolutions |> List.map (fun r -> r.originalReference) - TcAssemblyResolutions.ResolveAssemblyReferences(tcConfig, references, knownUnresolved) + TcAssemblyResolutions.ResolveAssemblyReferences(tcConfig, assemblyList, tcConfig.knownUnresolvedReferences) static member GetAssemblyResolutionInformation(tcConfig: TcConfig) = use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter let assemblyList = TcAssemblyResolutions.GetAllDllReferences tcConfig - - let resolutions = - TcAssemblyResolutions.ResolveAssemblyReferences(tcConfig, assemblyList, []) - - resolutions.GetAssemblyResolutions(), resolutions.GetUnresolvedReferences() + TcAssemblyResolutions.ResolveAssemblyReferences(tcConfig, assemblyList, []) //---------------------------------------------------------------------------- // Abstraction for project reference @@ -1039,13 +979,7 @@ and TcImportsWeakHack(tciLock: TcImportsLock, tcImports: WeakReference List.map (fun x -> { FileName = x.FileName })) - member _.Base: TcImportsWeakHack option = - match tcImports.TryGetTarget() with - | true, strong -> - match strong.Base with - | Some (baseTcImports: TcImports) -> Some baseTcImports.Weak - | _ -> None - | _ -> None + member self.Base: TcImportsWeakHack option = Some self member _.SystemRuntimeContainsType typeName = match tcImports.TryGetTarget() with @@ -1055,13 +989,7 @@ and TcImportsWeakHack(tciLock: TcImportsLock, tcImports: WeakReference] TcImports - ( - tcConfigP: TcConfigProvider, - initialResolutions: TcAssemblyResolutions, - importsBase: TcImports option, - dependencyProviderOpt: DependencyProvider option - ) as this +and [] TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolutions, dependencyProvider: DependencyProvider) as this #if !NO_TYPEPROVIDERS #endif = @@ -1140,16 +1068,6 @@ and [] TcImports | None -> false | None -> false - member internal tcImports.Base = - CheckDisposed() - importsBase - - member tcImports.CcuTable = - tciLock.AcquireLock(fun tcitok -> - RequireTcImportsLock(tcitok, ccuTable) - CheckDisposed() - ccuTable) - member tcImports.DllTable = tciLock.AcquireLock(fun tcitok -> RequireTcImportsLock(tcitok, dllTable) @@ -1186,37 +1104,22 @@ and [] TcImports tciLock.AcquireLock(fun tcitok -> CheckDisposed() RequireTcImportsLock(tcitok, dllInfos) - - match importsBase with - | Some importsBase -> importsBase.GetDllInfos() @ dllInfos - | None -> dllInfos) + dllInfos) member tcImports.AllAssemblyResolutions() = tciLock.AcquireLock(fun tcitok -> CheckDisposed() RequireTcImportsLock(tcitok, resolutions) - let ars = resolutions.GetAssemblyResolutions() - - match importsBase with - | Some importsBase -> importsBase.AllAssemblyResolutions() @ ars - | None -> ars) + resolutions.GetAssemblyResolutions()) member tcImports.TryFindDllInfo(ctok: CompilationThreadToken, m, assemblyName, lookupOnly) = CheckDisposed() - let rec look (t: TcImports) = - match NameMap.tryFind assemblyName t.DllTable with - | Some res -> Some res - | None -> - match t.Base with - | Some t2 -> look t2 - | None -> None - - match look tcImports with + match NameMap.tryFind assemblyName dllTable with | Some res -> Some res | None -> tcImports.ImplicitLoadIfAllowed(ctok, m, assemblyName, lookupOnly) - look tcImports + NameMap.tryFind assemblyName dllTable member tcImports.FindDllInfo(ctok, m, assemblyName) = match tcImports.TryFindDllInfo(ctok, m, assemblyName, lookupOnly = false) with @@ -1227,16 +1130,7 @@ and [] TcImports tciLock.AcquireLock(fun tcitok -> CheckDisposed() RequireTcImportsLock(tcitok, ccuInfos) - - match importsBase with - | Some importsBase -> List.append (importsBase.GetImportedAssemblies()) ccuInfos - | None -> ccuInfos) - - member tcImports.GetCcusExcludingBase() = - tciLock.AcquireLock(fun tcitok -> - CheckDisposed() - RequireTcImportsLock(tcitok, ccuInfos) - ccuInfos |> List.map (fun x -> x.FSharpViewOfMetadata)) + ccuInfos) member tcImports.GetCcusInDeclOrder() = CheckDisposed() @@ -1246,20 +1140,12 @@ and [] TcImports member tcImports.FindCcuInfo(ctok, m, assemblyName, lookupOnly) = CheckDisposed() - let rec look (t: TcImports) = - match NameMap.tryFind assemblyName t.CcuTable with - | Some res -> Some res - | None -> - match t.Base with - | Some t2 -> look t2 - | None -> None - - match look tcImports with + match NameMap.tryFind assemblyName ccuTable with | Some res -> ResolvedImportedAssembly res | None -> tcImports.ImplicitLoadIfAllowed(ctok, m, assemblyName, lookupOnly) - match look tcImports with + match NameMap.tryFind assemblyName ccuTable with | Some res -> ResolvedImportedAssembly res | None -> UnresolvedImportedAssembly assemblyName @@ -1280,15 +1166,7 @@ and [] TcImports member tcImports.TryFindXmlDocumentationInfo(assemblyName: string) = CheckDisposed() - let rec look (t: TcImports) = - match NameMap.tryFind assemblyName t.CcuTable with - | Some res -> Some res - | None -> - match t.Base with - | Some t2 -> look t2 - | None -> None - - match look tcImports with + match NameMap.tryFind assemblyName ccuTable with | Some res -> res.FSharpViewOfMetadata.Deref.XmlDocumentationInfo | _ -> None @@ -1506,12 +1384,7 @@ and [] TcImports member _.DependencyProvider = CheckDisposed() - - match dependencyProviderOpt with - | None -> - Debug.Assert(false, "this should never be called on FrameworkTcImports") - new DependencyProvider() - | Some dependencyProvider -> dependencyProvider + dependencyProvider member tcImports.GetImportMap() = CheckDisposed() @@ -1554,10 +1427,7 @@ and [] TcImports match tcGlobals with | Some g -> g - | None -> - match importsBase with - | Some b -> b.GetTcGlobals() - | None -> failwith "unreachable: GetGlobals - are the references to mscorlib.dll and FSharp.Core.dll valid?" + | None -> failwith "unreachable: GetGlobals - are the references to mscorlib.dll and FSharp.Core.dll valid?" member private tcImports.SetTcGlobals g = CheckDisposed() @@ -2282,23 +2152,24 @@ and [] TcImports // Note: This returns a TcImports object. However, framework TcImports are not currently disposed. The only reason // we dispose TcImports is because we need to dispose type providers, and type providers are never included in the framework DLL set. // If a framework set ever includes type providers, you will not have to worry about explicitly calling Dispose as the Finalizer will handle it. - static member BuildFrameworkTcImports(tcConfigP: TcConfigProvider, frameworkDLLs, nonFrameworkDLLs) = + static member BuildTcImports + ( + tcConfigP: TcConfigProvider, + tcResolutions: TcAssemblyResolutions, + dependencyProvider: DependencyProvider + ) = node { let ctok = CompilationThreadToken() let tcConfig = tcConfigP.Get ctok - let tcResolutions = - TcAssemblyResolutions.BuildFromPriorResolutions(tcConfig, frameworkDLLs, []) + let tcImports = new TcImports(tcConfigP, tcResolutions, dependencyProvider) - let tcAltResolutions = - TcAssemblyResolutions.BuildFromPriorResolutions(tcConfig, nonFrameworkDLLs, []) - - let frameworkTcImports = new TcImports(tcConfigP, tcResolutions, None, None) + let resolutions = tcResolutions.GetAssemblyResolutions() // Fetch the primaryAssembly from the referenced assemblies otherwise let primaryAssemblyReference = let path = - frameworkDLLs + resolutions |> List.tryFind (fun dll -> let baseName = Path.GetFileNameWithoutExtension(dll.resolvedPath) @@ -2312,9 +2183,9 @@ and [] TcImports | None -> tcConfig.PrimaryAssemblyDllReference() let primaryAssemblyResolution = - frameworkTcImports.ResolveAssemblyReference(ctok, primaryAssemblyReference, ResolveAssemblyReferenceMode.ReportErrors) + tcImports.ResolveAssemblyReference(ctok, primaryAssemblyReference, ResolveAssemblyReferenceMode.ReportErrors) - let! primaryAssem = frameworkTcImports.RegisterAndImportReferencedAssemblies(ctok, primaryAssemblyResolution) + let! primaryAssem = tcImports.RegisterAndImportReferencedAssemblies(ctok, primaryAssemblyResolution) let primaryScopeRef = match primaryAssem with @@ -2371,14 +2242,12 @@ and [] TcImports match tcResolutions.TryFindByOriginalReference coreLibraryReference with | Some resolution -> Some resolution | _ -> - // Are we using a "non-canonical" FSharp.Core? - match tcAltResolutions.TryFindByOriginalReference coreLibraryReference with - | Some resolution -> Some resolution - | _ -> tcResolutions.TryFindByOriginalReferenceText getFSharpCoreLibraryName // was the ".dll" elided? + // was the ".dll" elided? + tcResolutions.TryFindByOriginalReferenceText getFSharpCoreLibraryName match resolvedAssemblyRef with | Some coreLibraryResolution -> - match! frameworkTcImports.RegisterAndImportReferencedAssemblies(ctok, [ coreLibraryResolution ]) with + match! tcImports.RegisterAndImportReferencedAssemblies(ctok, [ coreLibraryResolution ]) with | _, [ ResolvedImportedAssembly fslibCcuInfo ] -> return fslibCcuInfo.FSharpViewOfMetadata, fslibCcuInfo.ILScopeRef | _ -> @@ -2393,13 +2262,13 @@ and [] TcImports } // Load the rest of the framework DLLs all at once (they may be mutually recursive) - let! _assemblies = frameworkTcImports.RegisterAndImportReferencedAssemblies(ctok, resolvedAssemblies) + let! _assemblies = tcImports.RegisterAndImportReferencedAssemblies(ctok, resolvedAssemblies) // These are the DLLs we can search for well-known types let sysCcus = [| - for ccu in frameworkTcImports.GetCcusInDeclOrder() do - ccu + for ccu in tcImports.GetImportedAssemblies() do + ccu.FSharpViewOfMetadata |] let tryFindSysTypeCcu path typeName = @@ -2429,8 +2298,8 @@ and [] TcImports // the global_g reference cell is used only for debug printing global_g <- Some tcGlobals #endif - frameworkTcImports.SetTcGlobals tcGlobals - return tcGlobals, frameworkTcImports + tcImports.SetTcGlobals tcGlobals + return tcGlobals, tcImports } member tcImports.ReportUnresolvedAssemblyReferences knownUnresolved = @@ -2444,51 +2313,14 @@ and [] TcImports | UnresolvedAssemblyReference (file, originalReferences) -> file, originalReferences) |> List.iter reportAssemblyNotResolved - static member BuildNonFrameworkTcImports - ( - tcConfigP: TcConfigProvider, - baseTcImports, - nonFrameworkReferences, - knownUnresolved, - dependencyProvider - ) = - - node { - let ctok = CompilationThreadToken() - let tcConfig = tcConfigP.Get ctok - - let tcResolutions = - TcAssemblyResolutions.BuildFromPriorResolutions(tcConfig, nonFrameworkReferences, knownUnresolved) - - let references = tcResolutions.GetAssemblyResolutions() - - let tcImports = - new TcImports(tcConfigP, tcResolutions, Some baseTcImports, Some dependencyProvider) - - let! _assemblies = tcImports.RegisterAndImportReferencedAssemblies(ctok, references) - tcImports.ReportUnresolvedAssemblyReferences knownUnresolved - return tcImports - } - static member BuildTcImports(tcConfigP: TcConfigProvider, dependencyProvider) = node { let ctok = CompilationThreadToken() let tcConfig = tcConfigP.Get ctok - - let frameworkDLLs, nonFrameworkReferences, knownUnresolved = - TcAssemblyResolutions.SplitNonFoundationalResolutions(tcConfig) - - let! tcGlobals, frameworkTcImports = TcImports.BuildFrameworkTcImports(tcConfigP, frameworkDLLs, nonFrameworkReferences) - - let! tcImports = - TcImports.BuildNonFrameworkTcImports( - tcConfigP, - frameworkTcImports, - nonFrameworkReferences, - knownUnresolved, - dependencyProvider - ) - + let tcResolutions = TcAssemblyResolutions.ResolveAssemblyReferences(tcConfig) + let! tcGlobals, tcImports = TcImports.BuildTcImports(tcConfigP, tcResolutions, dependencyProvider) + let unresolved = tcResolutions.GetUnresolvedReferences() + tcImports.ReportUnresolvedAssemblyReferences unresolved return tcGlobals, tcImports } diff --git a/src/Compiler/Driver/CompilerImports.fsi b/src/Compiler/Driver/CompilerImports.fsi index d6be5bbd60b..311dd02ed7c 100644 --- a/src/Compiler/Driver/CompilerImports.fsi +++ b/src/Compiler/Driver/CompilerImports.fsi @@ -80,9 +80,6 @@ type AssemblyResolution = /// Create the tooltip text for the assembly reference prepareToolTip: unit -> string - /// Whether or not this is an installed system assembly (for example, System.dll) - sysdir: bool - /// Lazily populated ilAssemblyRef for this reference. mutable ilAssemblyRef: ILAssemblyRef option } @@ -124,14 +121,11 @@ type TcAssemblyResolutions = member GetAssemblyResolutions: unit -> AssemblyResolution list - static member SplitNonFoundationalResolutions: - tcConfig: TcConfig -> AssemblyResolution list * AssemblyResolution list * UnresolvedAssemblyReference list + member GetUnresolvedReferences: unit -> UnresolvedAssemblyReference list - static member BuildFromPriorResolutions: - tcConfig: TcConfig * AssemblyResolution list * UnresolvedAssemblyReference list -> TcAssemblyResolutions + static member ResolveAssemblyReferences: tcConfig: TcConfig -> TcAssemblyResolutions - static member GetAssemblyResolutionInformation: - tcConfig: TcConfig -> AssemblyResolution list * UnresolvedAssemblyReference list + static member GetAssemblyResolutionInformation: tcConfig: TcConfig -> TcAssemblyResolutions [] type RawFSharpAssemblyData = @@ -153,9 +147,6 @@ type TcImports = member GetCcusInDeclOrder: unit -> CcuThunk list - /// This excludes any framework imports (which may be shared between multiple builds) - member GetCcusExcludingBase: unit -> CcuThunk list - member FindDllInfo: CompilationThreadToken * range * string -> ImportedBinary member TryFindDllInfo: CompilationThreadToken * range * string * lookupOnly: bool -> ImportedBinary option @@ -196,14 +187,9 @@ type TcImports = member SystemRuntimeContainsType: string -> bool - member internal Base: TcImports option - - static member BuildFrameworkTcImports: - TcConfigProvider * AssemblyResolution list * AssemblyResolution list -> NodeCode - - static member BuildNonFrameworkTcImports: - TcConfigProvider * TcImports * AssemblyResolution list * UnresolvedAssemblyReference list * DependencyProvider -> - NodeCode + static member BuildTcImports: + tcConfigP: TcConfigProvider * tcResolutions: TcAssemblyResolutions * dependencyProvider: DependencyProvider -> + NodeCode static member BuildTcImports: tcConfigP: TcConfigProvider * dependencyProvider: DependencyProvider -> NodeCode diff --git a/src/Compiler/Driver/ScriptClosure.fs b/src/Compiler/Driver/ScriptClosure.fs index 868a9f80cae..1e7fb687034 100644 --- a/src/Compiler/Driver/ScriptClosure.fs +++ b/src/Compiler/Driver/ScriptClosure.fs @@ -571,11 +571,13 @@ module ScriptPreprocessClosure = use unwindEL = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> diagnosticsLogger) - let references, unresolvedReferences = - TcAssemblyResolutions.GetAssemblyResolutionInformation(tcConfig) + let tcResolutions = TcAssemblyResolutions.GetAssemblyResolutionInformation(tcConfig) + + let resolutions = tcResolutions.GetAssemblyResolutions() + let unresolved = tcResolutions.GetUnresolvedReferences() - let references = references |> List.map (fun ar -> ar.resolvedPath, ar) - references, unresolvedReferences, diagnosticsLogger.Diagnostics + let references = resolutions |> List.map (fun ar -> ar.resolvedPath, ar) + references, unresolved, diagnosticsLogger.Diagnostics // Root errors and warnings - look at the last item in the closureFiles list let loadClosureRootDiagnostics, allRootDiagnostics = @@ -662,14 +664,13 @@ module ScriptPreprocessClosure = reduceMemoryUsage ) - let resolutions0, _unresolvedReferences = + let tcResolutions0 = TcAssemblyResolutions.GetAssemblyResolutionInformation(tcConfig) let references0 = - resolutions0 + tcResolutions0.GetAssemblyResolutions() |> List.map (fun r -> r.originalReference.Range, r.resolvedPath) - |> Seq.distinct - |> List.ofSeq + |> List.distinct references0, tcConfig.assumeDotNetFramework, scriptDefaultReferencesDiagnostics diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index 28174489a61..87f5652b2b2 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -546,7 +546,7 @@ let main1 if not bannerAlreadyPrinted then Console.Write(GetBannerText tcConfigB) - // Create tcGlobals and frameworkTcImports + // Create tcGlobals and tcImports let outfile, pdbfile, assemblyName = try tcConfigB.DecideNames sourceFiles @@ -585,22 +585,19 @@ let main1 ReportTime tcConfig "Import mscorlib and FSharp.Core.dll" let foundationalTcConfigP = TcConfigProvider.Constant tcConfig - let sysRes, otherRes, knownUnresolved = - TcAssemblyResolutions.SplitNonFoundationalResolutions(tcConfig) - - // Import basic assemblies - let tcGlobals, frameworkTcImports = - TcImports.BuildFrameworkTcImports(foundationalTcConfigP, sysRes, otherRes) + // Import assemblies + let tcGlobals, tcImports = + TcImports.BuildTcImports(foundationalTcConfigP, dependencyProvider) |> NodeCode.RunImmediateWithoutCancellation + // register tcImports to be disposed in future + disposables.Register tcImports + let ilSourceDocs = [ for sourceFile in sourceFiles -> tcGlobals.memoize_file (FileIndex.fileIndexOfFile sourceFile) ] - // Register framework tcImports to be disposed in future - disposables.Register frameworkTcImports - // Parse sourceFiles ReportTime tcConfig "Parse inputs" use unwindParsePhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse @@ -636,18 +633,6 @@ let main1 ||> List.fold (fun z (input, sourceFileDirectory) -> ApplyMetaCommandsFromInputToTcConfig(z, input, sourceFileDirectory, dependencyProvider)) - let tcConfigP = TcConfigProvider.Constant tcConfig - - // Import other assemblies - ReportTime tcConfig "Import non-system references" - - let tcImports = - TcImports.BuildNonFrameworkTcImports(tcConfigP, frameworkTcImports, otherRes, knownUnresolved, dependencyProvider) - |> NodeCode.RunImmediateWithoutCancellation - - // register tcImports to be disposed in future - disposables.Register tcImports - if not tcConfig.continueAfterParseFailure then AbortOnError(diagnosticsLogger, exiter) @@ -687,7 +672,6 @@ let main1 ctok, tcGlobals, tcImports, - frameworkTcImports, tcState.Ccu, typedAssembly, topAttrs, @@ -812,16 +796,13 @@ let main1OfAst ReportTime tcConfig "Import mscorlib and FSharp.Core.dll" let foundationalTcConfigP = TcConfigProvider.Constant tcConfig - let sysRes, otherRes, knownUnresolved = - TcAssemblyResolutions.SplitNonFoundationalResolutions(tcConfig) - // Import basic assemblies - let tcGlobals, frameworkTcImports = - TcImports.BuildFrameworkTcImports(foundationalTcConfigP, sysRes, otherRes) + let tcGlobals, tcImports = + TcImports.BuildTcImports(foundationalTcConfigP, dependencyProvider) |> NodeCode.RunImmediateWithoutCancellation - // Register framework tcImports to be disposed in future - disposables.Register frameworkTcImports + // register tcImports to be disposed in future + disposables.Register tcImports use unwindParsePhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse @@ -831,18 +812,6 @@ let main1OfAst (tcConfig, inputs) ||> List.fold (fun tcc inp -> ApplyMetaCommandsFromInputToTcConfig(tcc, inp, meta, dependencyProvider)) - let tcConfigP = TcConfigProvider.Constant tcConfig - - // Import other assemblies - ReportTime tcConfig "Import non-system references" - - let tcImports = - TcImports.BuildNonFrameworkTcImports(tcConfigP, frameworkTcImports, otherRes, knownUnresolved, dependencyProvider) - |> NodeCode.RunImmediateWithoutCancellation - - // register tcImports to be disposed in future - disposables.Register tcImports - // Build the initial type checking environment ReportTime tcConfig "Typecheck" use unwindParsePhase = PushThreadBuildPhaseUntilUnwind BuildPhase.TypeCheck @@ -873,7 +842,6 @@ let main1OfAst ctok, tcGlobals, tcImports, - frameworkTcImports, tcState.Ccu, typedAssembly, topAttrs, @@ -892,7 +860,6 @@ let main2 (Args (ctok, tcGlobals, tcImports: TcImports, - frameworkTcImports, generatedCcu: CcuThunk, typedImplFiles, topAttrs, @@ -975,7 +942,6 @@ let main2 ctok, tcConfig, tcImports, - frameworkTcImports, tcGlobals, diagnosticsLogger, generatedCcu, @@ -997,8 +963,7 @@ let main2 let main3 (Args (ctok, tcConfig, - tcImports, - frameworkTcImports: TcImports, + tcImports: TcImports, tcGlobals, diagnosticsLogger: DiagnosticsLogger, generatedCcu: CcuThunk, @@ -1028,7 +993,7 @@ let main3 match tcConfig.metadataVersion with | Some v -> v | _ -> - match frameworkTcImports.DllTable.TryFind tcConfig.primaryAssembly.Name with + match tcImports.DllTable.TryFind tcConfig.primaryAssembly.Name with | Some ib -> ib.RawMetadata.TryGetILModuleDef().Value.MetadataVersion | _ -> "" diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 316dfd429bb..9b8182c7467 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -3308,8 +3308,8 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i match fsiOptions.WriteReferencesAndExit with | Some outFile -> let tcConfig = tcConfigP.Get(ctokStartup) - let references, _unresolvedReferences = TcAssemblyResolutions.GetAssemblyResolutionInformation(tcConfig) - let lines = [ for r in references -> r.resolvedPath ] + let tcResolutions = TcAssemblyResolutions.GetAssemblyResolutionInformation(tcConfig) + let lines = [ for r in tcResolutions.GetAssemblyResolutions() -> r.resolvedPath ] FileSystem.OpenFileForWriteShim(outFile).WriteAllLines(lines) exit 0 | _ -> () @@ -3346,21 +3346,13 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i /// on the FsiEvaluationSession. let checker = FSharpChecker.Create(legacyReferenceResolver=legacyReferenceResolver) - let tcGlobals,frameworkTcImports,nonFrameworkResolutions,unresolvedReferences = + let tcGlobals, tcImports = try - let tcConfig = tcConfigP.Get(ctokStartup) - checker.FrameworkImportsCache.Get tcConfig + TcImports.BuildTcImports(tcConfigP, fsiOptions.DependencyProvider) |> NodeCode.RunImmediateWithoutCancellation with e -> stopProcessingRecovery e range0; failwithf "Error creating evaluation session: %A" e - let tcImports = - try - TcImports.BuildNonFrameworkTcImports(tcConfigP, frameworkTcImports, nonFrameworkResolutions, unresolvedReferences, fsiOptions.DependencyProvider) - |> NodeCode.RunImmediateWithoutCancellation - with e -> - stopProcessingRecovery e range0; failwithf "Error creating evaluation session: %A" e - let niceNameGen = NiceNameGenerator() // Share intern'd strings across all lexing/parsing diff --git a/src/Compiler/Service/IncrementalBuild.fs b/src/Compiler/Service/IncrementalBuild.fs index 45e50d441bf..4004fe0e12a 100644 --- a/src/Compiler/Service/IncrementalBuild.fs +++ b/src/Compiler/Service/IncrementalBuild.fs @@ -590,66 +590,6 @@ type BoundModel private (tcConfig: TcConfig, syntaxTreeOpt, None) -/// Global service state -type FrameworkImportsCacheKey = FrameworkImportsCacheKey of resolvedpath: string list * assemblyName: string * targetFrameworkDirectories: string list * fsharpBinaries: string * langVersion: decimal - -/// Represents a cache of 'framework' references that can be shared between multiple incremental builds -type FrameworkImportsCache(size) = - - let gate = obj() - - // Mutable collection protected via CompilationThreadToken - let frameworkTcImportsCache = AgedLookup>(size, areSimilar=(fun (x, y) -> x = y)) - - /// Reduce the size of the cache in low-memory scenarios - member _.Downsize() = frameworkTcImportsCache.Resize(AnyCallerThread, newKeepStrongly=0) - - /// Clear the cache - member _.Clear() = frameworkTcImportsCache.Clear AnyCallerThread - - /// This function strips the "System" assemblies from the tcConfig and returns a age-cached TcImports for them. - member _.GetNode(tcConfig: TcConfig, frameworkDLLs: AssemblyResolution list, nonFrameworkResolutions: AssemblyResolution list) = - let frameworkDLLsKey = - frameworkDLLs - |> List.map (fun ar->ar.resolvedPath) // The cache key. Just the minimal data. - |> List.sort // Sort to promote cache hits. - - // Prepare the frameworkTcImportsCache - // - // The data elements in this key are very important. There should be nothing else in the TcConfig that logically affects - // the import of a set of framework DLLs into F# CCUs. That is, the F# CCUs that result from a set of DLLs (including - // FSharp.Core.dll and mscorlib.dll) must be logically invariant of all the other compiler configuration parameters. - let key = - FrameworkImportsCacheKey(frameworkDLLsKey, - tcConfig.primaryAssembly.Name, - tcConfig.GetTargetFrameworkDirectories(), - tcConfig.fsharpBinariesDir, - tcConfig.langVersion.SpecifiedVersion) - - let node = - lock gate (fun () -> - match frameworkTcImportsCache.TryGet (AnyCallerThread, key) with - | Some lazyWork -> lazyWork - | None -> - let lazyWork = GraphNode(node { - let tcConfigP = TcConfigProvider.Constant tcConfig - return! TcImports.BuildFrameworkTcImports (tcConfigP, frameworkDLLs, nonFrameworkResolutions) - }) - frameworkTcImportsCache.Put(AnyCallerThread, key, lazyWork) - lazyWork - ) - node - - /// This function strips the "System" assemblies from the tcConfig and returns a age-cached TcImports for them. - member this.Get(tcConfig: TcConfig) = - node { - // Split into installed and not installed. - let frameworkDLLs, nonFrameworkResolutions, unresolved = TcAssemblyResolutions.SplitNonFoundationalResolutions(tcConfig) - let node = this.GetNode(tcConfig, frameworkDLLs, nonFrameworkResolutions) - let! tcGlobals, frameworkTcImports = node.GetOrComputeValue() - return tcGlobals, frameworkTcImports, nonFrameworkResolutions, unresolved - } - /// Represents the interim state of checking an assembly [] type PartialCheckResults (boundModel: BoundModel, timeStamp: DateTime, projectTimeStamp: DateTime) = @@ -738,12 +678,7 @@ module IncrementalBuilderHelpers = let CombineImportedAssembliesTask ( assemblyName, tcConfig: TcConfig, - tcConfigP, - tcGlobals, - frameworkTcImports, - nonFrameworkResolutions, - unresolvedReferences, - dependencyProvider, + tcImportsNode: GraphNode, loadClosureOpt: LoadClosure option, niceNameGen, basicDependencies, @@ -760,38 +695,34 @@ module IncrementalBuilderHelpers = let diagnosticsLogger = CompilationDiagnosticLogger("CombineImportedAssembliesTask", tcConfig.diagnosticsOptions) use _ = new CompilationGlobalsScope(diagnosticsLogger, BuildPhase.Parameter) - let! tcImports = - node { - try - let! tcImports = TcImports.BuildNonFrameworkTcImports(tcConfigP, frameworkTcImports, nonFrameworkResolutions, unresolvedReferences, dependencyProvider) + let! tcGlobals, tcImports = tcImportsNode.GetOrComputeValue() + try #if !NO_TYPEPROVIDERS - tcImports.GetCcusExcludingBase() |> Seq.iter (fun ccu -> - // When a CCU reports an invalidation, merge them together and just report a - // general "imports invalidated". This triggers a rebuild. - // - // We are explicit about what the handler closure captures to help reason about the - // lifetime of captured objects, especially in case the type provider instance gets leaked - // or keeps itself alive mistakenly, e.g. via some global state in the type provider instance. - // - // The handler only captures - // 1. a weak reference to the importsInvalidated event. - // - // The IncrementalBuilder holds the strong reference the importsInvalidated event. - // - // In the invalidation handler we use a weak reference to allow the IncrementalBuilder to - // be collected if, for some reason, a TP instance is not disposed or not GC'd. - let capturedImportsInvalidated = WeakReference<_>(importsInvalidatedByTypeProvider) - ccu.Deref.InvalidateEvent.Add(fun _ -> - match capturedImportsInvalidated.TryGetTarget() with - | true, tg -> tg.Trigger() - | _ -> ())) + tcImports.GetImportedAssemblies() |> Seq.iter (fun assembly -> + let ccu = assembly.FSharpViewOfMetadata + // When a CCU reports an invalidation, merge them together and just report a + // general "imports invalidated". This triggers a rebuild. + // + // We are explicit about what the handler closure captures to help reason about the + // lifetime of captured objects, especially in case the type provider instance gets leaked + // or keeps itself alive mistakenly, e.g. via some global state in the type provider instance. + // + // The handler only captures + // 1. a weak reference to the importsInvalidated event. + // + // The IncrementalBuilder holds the strong reference the importsInvalidated event. + // + // In the invalidation handler we use a weak reference to allow the IncrementalBuilder to + // be collected if, for some reason, a TP instance is not disposed or not GC'd. + let capturedImportsInvalidated = WeakReference<_>(importsInvalidatedByTypeProvider) + ccu.Deref.InvalidateEvent.Add(fun _ -> + match capturedImportsInvalidated.TryGetTarget() with + | true, tg -> tg.Trigger() + | _ -> ())) #endif - return tcImports - with exn -> - Debug.Assert(false, sprintf "Could not BuildAllReferencedDllTcImports %A" exn) - diagnosticsLogger.Warning exn - return frameworkTcImports - } + with exn -> + Debug.Assert(false, sprintf "Could not BuildAllReferencedDllTcImports %A" exn) + diagnosticsLogger.Warning exn let tcInitial, openDecls0 = GetInitialTcEnv (assemblyName, rangeStartup, tcConfig, tcImports, tcGlobals) let tcState = GetInitialTcState (rangeStartup, assemblyName, tcConfig, tcGlobals, tcImports, niceNameGen, tcInitial, openDecls0) @@ -848,10 +779,11 @@ module IncrementalBuilderHelpers = } /// Finish up the typechecking to produce outputs for the rest of the compilation process - let FinalizeTypeCheckTask (tcConfig: TcConfig) tcGlobals enablePartialTypeChecking assemblyName outfile (boundModels: ImmutableArray) = + let FinalizeTypeCheckTask (tcConfig: TcConfig, tcImportsNode: GraphNode, enablePartialTypeChecking, assemblyName, outfile, boundModels: ImmutableArray) = node { let diagnosticsLogger = CompilationDiagnosticLogger("FinalizeTypeCheckTask", tcConfig.diagnosticsOptions) use _ = new CompilationGlobalsScope(diagnosticsLogger, BuildPhase.TypeCheck) + let! tcGlobals, _tcImports = tcImportsNode.GetOrComputeValue() let! results = boundModels @@ -943,7 +875,7 @@ module IncrementalBuilderHelpers = type IncrementalBuilderInitialState = { initialBoundModel: BoundModel - tcGlobals: TcGlobals + tcImportsNode: GraphNode referencedAssemblies: ImmutableArray * (TimeStampCache -> DateTime)> tcConfig: TcConfig outfile: string @@ -965,9 +897,9 @@ type IncrementalBuilderInitialState = static member Create( initialBoundModel: BoundModel, - tcGlobals, - nonFrameworkAssemblyInputs, tcConfig: TcConfig, + tcImportsNode, + assemblyInputs, outfile, assemblyName, lexResourceManager, @@ -984,8 +916,8 @@ type IncrementalBuilderInitialState = let initialState = { initialBoundModel = initialBoundModel - tcGlobals = tcGlobals - referencedAssemblies = nonFrameworkAssemblyInputs |> ImmutableArray.ofSeq + tcImportsNode = tcImportsNode + referencedAssemblies = assemblyInputs |> ImmutableArray.ofSeq tcConfig = tcConfig outfile = outfile assemblyName = assemblyName @@ -1045,13 +977,13 @@ module IncrementalBuilderStateHelpers = |> ImmutableArray.map (fun x -> x.TryPeekValue().Value) let! result = - FinalizeTypeCheckTask - initialState.tcConfig - initialState.tcGlobals - initialState.enablePartialTypeChecking - initialState.assemblyName - initialState.outfile - boundModels + FinalizeTypeCheckTask ( + initialState.tcConfig, + initialState.tcImportsNode, + initialState.enablePartialTypeChecking, + initialState.assemblyName, + initialState.outfile, + boundModels) let result = (result, DateTime.UtcNow) return result }) @@ -1418,7 +1350,6 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc ( legacyReferenceResolver, defaultFSharpBinariesDir, - frameworkTcImportsCache: FrameworkImportsCache, loadClosureOpt: LoadClosure option, sourceFiles: string list, commandLineArgs: string list, @@ -1432,7 +1363,7 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc keepAllBackgroundSymbolUses, enableBackgroundItemKeyStoreAndSemanticClassification, enablePartialTypeChecking: bool, - dependencyProvider + dependencyProviderOpt ) = let useSimpleResolutionSwitch = "--simpleresolution" @@ -1544,28 +1475,43 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc let niceNameGen = NiceNameGenerator() let outfile, _, assemblyName = tcConfigB.DecideNames sourceFiles + // For scripts, the dependency provider is already available. + // For projects create a fresh one for the project. + let dependencyProvider = + match dependencyProviderOpt with + | None -> new DependencyProvider() + | Some dependencyProvider -> dependencyProvider + // Resolve assemblies and create the framework TcImports. This is done when constructing the // builder itself, rather than as an incremental task. This caches a level of "system" references. No type providers are // included in these references. - let! tcGlobals, frameworkTcImports, nonFrameworkResolutions, unresolvedReferences = frameworkTcImportsCache.Get(tcConfig) + let tcResolutions = TcAssemblyResolutions.ResolveAssemblyReferences(tcConfig) + + let tcConfigP = TcConfigProvider.Constant tcConfig + let tcImportsNode = GraphNode(node { + return! TcImports.BuildTcImports (tcConfigP, tcResolutions, dependencyProvider) + }) // Note we are not calling diagnosticsLogger.GetDiagnostics() anywhere for this task. // This is ok because not much can actually go wrong here. let diagnosticsLogger = CompilationDiagnosticLogger("nonFrameworkAssemblyInputs", tcConfig.diagnosticsOptions) use _ = new CompilationGlobalsScope(diagnosticsLogger, BuildPhase.Parameter) - // Get the names and time stamps of all the non-framework referenced assemblies, which will act + let unresolvedReferences = tcResolutions.GetUnresolvedReferences() + let resolutions = tcResolutions.GetAssemblyResolutions() + + // Get the names and time stamps of all the referenced assemblies, which will act // as inputs to one of the nodes in the build. // // This operation is done when constructing the builder itself, rather than as an incremental task. - let nonFrameworkAssemblyInputs = + let assemblyInputs = // Note we are not calling diagnosticsLogger.GetDiagnostics() anywhere for this task. // This is ok because not much can actually go wrong here. let diagnosticsLogger = CompilationDiagnosticLogger("nonFrameworkAssemblyInputs", tcConfig.diagnosticsOptions) // Return the disposable object that cleans up use _holder = new CompilationGlobalsScope(diagnosticsLogger, BuildPhase.Parameter) - [ for r in nonFrameworkResolutions do + [ for r in resolutions do let fileName = r.resolvedPath yield (Choice1Of2 fileName, (fun (cache: TimeStampCache) -> cache.GetFileTimeStamp fileName)) @@ -1574,7 +1520,6 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc // Start importing - let tcConfigP = TcConfigProvider.Constant tcConfig let beforeFileChecked = Event() let fileChecked = Event() @@ -1595,35 +1540,23 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc // Exclude things that are definitely not a file name if not(FileSystem.IsInvalidPathShim referenceText) then let file = if FileSystem.IsPathRootedShim referenceText then referenceText else Path.Combine(projectDirectory, referenceText) - yield file + file - for r in nonFrameworkResolutions do - yield r.resolvedPath ] + for r in resolutions do + r.resolvedPath ] let allDependencies = [| yield! basicDependencies for _, f, _ in sourceFiles do yield f |] - // For scripts, the dependency provider is already available. - // For projects create a fresh one for the project. - let dependencyProvider = - match dependencyProvider with - | None -> new DependencyProvider() - | Some dependencyProvider -> dependencyProvider - let defaultTimeStamp = DateTime.UtcNow let! initialBoundModel = CombineImportedAssembliesTask( assemblyName, tcConfig, - tcConfigP, - tcGlobals, - frameworkTcImports, - nonFrameworkResolutions, - unresolvedReferences, - dependencyProvider, + tcImportsNode, loadClosureOpt, niceNameGen, basicDependencies, @@ -1646,9 +1579,9 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc let initialState = IncrementalBuilderInitialState.Create( initialBoundModel, - tcGlobals, - nonFrameworkAssemblyInputs, tcConfig, + tcImportsNode, + assemblyInputs, outfile, assemblyName, resourceManager, diff --git a/src/Compiler/Service/IncrementalBuild.fsi b/src/Compiler/Service/IncrementalBuild.fsi index cca65bcace1..5d6f8df5a0f 100755 --- a/src/Compiler/Service/IncrementalBuild.fsi +++ b/src/Compiler/Service/IncrementalBuild.fsi @@ -23,16 +23,6 @@ open FSharp.Compiler.Text open FSharp.Compiler.TypedTree open FSharp.Compiler.BuildGraph -/// Lookup the global static cache for building the FrameworkTcImports -type internal FrameworkImportsCache = - new: size: int -> FrameworkImportsCache - - member Get: TcConfig -> NodeCode - - member Clear: unit -> unit - - member Downsize: unit -> unit - /// Used for unit testing module internal IncrementalBuilderEventTesting = @@ -249,7 +239,6 @@ type internal IncrementalBuilder = static member TryCreateIncrementalBuilderForProjectOptions: legacyReferenceResolver: LegacyReferenceResolver * defaultFSharpBinariesDir: string * - frameworkTcImportsCache: FrameworkImportsCache * loadClosureOpt: LoadClosure option * sourceFiles: string list * commandLineArgs: string list * @@ -263,7 +252,7 @@ type internal IncrementalBuilder = keepAllBackgroundSymbolUses: bool * enableBackgroundItemKeyStoreAndSemanticClassification: bool * enablePartialTypeChecking: bool * - dependencyProvider: DependencyProvider option -> + dependencyProviderOpt: DependencyProvider option -> NodeCode /// Generalized Incremental Builder. This is exposed only for unit testing purposes. diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index e58b5be8261..7841bbac0d2 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -309,8 +309,6 @@ type BackgroundCompiler areSimilar = FSharpProjectOptions.UseSameProject ) - let frameworkTcImportsCache = FrameworkImportsCache(frameworkTcImportsCacheStrongSize) - // We currently share one global dependency provider for all scripts for the FSharpChecker. // For projects, one is used per project. // @@ -405,7 +403,6 @@ type BackgroundCompiler IncrementalBuilder.TryCreateIncrementalBuilderForProjectOptions( legacyReferenceResolver, FSharpCheckerResultsSettings.defaultFSharpBinariesDir, - frameworkTcImportsCache, loadClosure, Array.toList options.SourceFiles, Array.toList options.OtherOptions, @@ -1180,7 +1177,6 @@ type BackgroundCompiler parseFileCache.Clear(ltok)) incrementalBuildersCache.Clear(AnyCallerThread) - frameworkTcImportsCache.Clear() scriptClosureCache.Clear AnyCallerThread) member _.DownsizeCaches() = @@ -1190,11 +1186,8 @@ type BackgroundCompiler parseFileCache.Resize(ltok, newKeepStrongly = 1)) incrementalBuildersCache.Resize(AnyCallerThread, newKeepStrongly = 1, newKeepMax = 1) - frameworkTcImportsCache.Downsize() scriptClosureCache.Resize(AnyCallerThread, newKeepStrongly = 1, newKeepMax = 1)) - member _.FrameworkImportsCache = frameworkTcImportsCache - static member ActualParseFileCount = actualParseFileCount static member ActualCheckFileCount = actualCheckFileCount @@ -1696,8 +1689,6 @@ type FSharpChecker static member Instance = globalInstance.Force() - member internal _.FrameworkImportsCache = backgroundCompiler.FrameworkImportsCache - /// Tokenize a single line, returning token information and a tokenization state represented by an integer member _.TokenizeLine(line: string, state: FSharpTokenizerLexState) = let tokenizer = FSharpSourceTokenizer([], None) diff --git a/src/Compiler/Service/service.fsi b/src/Compiler/Service/service.fsi index 25a5a2b412e..e1cc2c010fd 100644 --- a/src/Compiler/Service/service.fsi +++ b/src/Compiler/Service/service.fsi @@ -464,7 +464,7 @@ type public FSharpChecker = [] static member Instance: FSharpChecker - member internal FrameworkImportsCache: FrameworkImportsCache + member internal ReferenceResolver: LegacyReferenceResolver /// Tokenize a single line, returning token information and a tokenization state represented by an integer