@@ -346,14 +346,6 @@ type internal TransparentCompiler
346346 let fileChecked = Event< string * FSharpProjectOptions>()
347347 let projectChecked = Event< FSharpProjectOptions>()
348348
349- /// Information about the derived script closure.
350- let scriptClosureCache =
351- MruCache< AnyCallerThreadToken, FSharpProjectOptions, LoadClosure>(
352- projectCacheSize,
353- areSame = FSharpProjectOptions.AreSameForChecking,
354- areSimilar = FSharpProjectOptions.UseSameProject
355- )
356-
357349 // use this to process not-yet-implemented tasks
358350 let backgroundCompiler =
359351 BackgroundCompiler(
@@ -560,7 +552,7 @@ type internal TransparentCompiler
560552 getProjectReferences projectSnapshot " ComputeTcConfigBuilder"
561553
562554 let loadClosureOpt : LoadClosure option =
563- scriptClosureCache .TryGet( AnyCallerThread, projectSnapshot.ToOptions())
555+ backgroundCompiler.ScriptClosureCache .TryGet( AnyCallerThread, projectSnapshot.ToOptions())
564556
565557 let getSwitchValue ( switchString : string ) =
566558 match commandLineArgs |> List.tryFindIndex ( fun s -> s.StartsWithOrdinal switchString) with
@@ -1417,7 +1409,7 @@ type internal TransparentCompiler
14171409 [| yield ! creationDiags; yield ! extraDiagnostics; yield ! tcDiagnostics |]
14181410
14191411 let loadClosure =
1420- scriptClosureCache .TryGet( AnyCallerThread, projectSnapshot.ToOptions())
1412+ backgroundCompiler.ScriptClosureCache .TryGet( AnyCallerThread, projectSnapshot.ToOptions())
14211413
14221414 let typedResults =
14231415 FSharpCheckFileResults.Make(
@@ -2078,3 +2070,5 @@ type internal TransparentCompiler
20782070 userOpName : string
20792071 ) : ( FSharpParseFileResults * FSharpCheckFileResults * SourceTextHash ) option =
20802072 backgroundCompiler.TryGetRecentCheckResultsForFile( fileName, options, sourceText, userOpName)
2073+
2074+ member _.ScriptClosureCache = backgroundCompiler.ScriptClosureCache
0 commit comments