@@ -1513,14 +1513,11 @@ module internal MagicAssemblyResolution =
15131513
15141514 let Install ( tcConfigB , tcImports : TcImports , fsiDynamicCompiler : FsiDynamicCompiler , fsiConsoleOutput : FsiConsoleOutput ) =
15151515
1516- let rangeStdin = rangeN Lexhelp.stdinMockFilename 0
1517-
15181516#if TODO_ REWORK_ ASSEMBLY_ LOAD
15191517 ignore tcConfigB
15201518 ignore tcImports
15211519 ignore fsiDynamicCompiler
15221520 ignore fsiConsoleOutput
1523- ignore rangeStdin
15241521 { new System.IDisposable with
15251522 member x.Dispose () = () }
15261523#else
@@ -2317,7 +2314,7 @@ let internal DriveFsiEventLoop (fsi: FsiEvaluationSessionHostConfig, fsiConsoleO
23172314
23182315/// The primary type, representing a full F# Interactive session, reading from the given
23192316/// text input, writing to the given text output and error writers.
2320- type FsiEvaluationSession ( fsi : FsiEvaluationSessionHostConfig , argv : string [], inReader : TextReader , outWriter : TextWriter , errorWriter : TextWriter , fsiCollectible : bool , msbuildEnabled : bool ) =
2317+ type FsiEvaluationSession ( fsi : FsiEvaluationSessionHostConfig , argv : string [], inReader : TextReader , outWriter : TextWriter , errorWriter : TextWriter , fsiCollectible : bool , msbuildEnabled : bool , checker : FSharpChecker ) =
23212318#if DYNAMIC_ CODE_ REWRITES_ CONSOLE_ WRITE
23222319 do
23232320 Microsoft.FSharp.Core.Printf.setWriter outWriter
@@ -2457,10 +2454,6 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i
24572454
24582455 let fsiConsoleInput = FsiConsoleInput( fsi, fsiOptions, inReader, outWriter)
24592456
2460- /// The single, global interactive checker that can be safely used in conjunction with other operations
2461- /// on the FsiEvaluationSession.
2462- let checker = FSharpChecker.Create()
2463-
24642457 let ( tcGlobals , frameworkTcImports , nonFrameworkResolutions , unresolvedReferences ) =
24652458 try
24662459 let tcConfig = tcConfigP.Get()
@@ -2721,8 +2714,12 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i
27212714 GC.KeepAlive fsiInterruptController.EventHandlers
27222715
27232716
2724- static member Create ( fsiConfig , argv , inReader , outWriter , errorWriter , ? collectible , ? msbuildEnabled ) =
2725- new FsiEvaluationSession( fsiConfig, argv, inReader, outWriter, errorWriter, defaultArg collectible false , defaultArg msbuildEnabled true )
2717+ static member Create ( fsiConfig , argv , inReader , outWriter , errorWriter , ? collectible , ? msbuildEnabled , ? checker ) =
2718+ /// The single, global interactive checker that can be safely used in conjunction with other operations
2719+ /// on the FsiEvaluationSession.
2720+ let checker = match checker with None -> FSharpChecker.Create() | Some c -> c
2721+
2722+ new FsiEvaluationSession( fsiConfig, argv, inReader, outWriter, errorWriter, defaultArg collectible false , defaultArg msbuildEnabled true , checker)
27262723
27272724 static member GetDefaultConfiguration ( fsiObj : obj ) = FsiEvaluationSession.GetDefaultConfiguration( fsiObj, true )
27282725
0 commit comments