@@ -1513,14 +1513,11 @@ module internal MagicAssemblyResolution =
1513
1513
1514
1514
let Install ( tcConfigB , tcImports : TcImports , fsiDynamicCompiler : FsiDynamicCompiler , fsiConsoleOutput : FsiConsoleOutput ) =
1515
1515
1516
- let rangeStdin = rangeN Lexhelp.stdinMockFilename 0
1517
-
1518
1516
#if TODO_ REWORK_ ASSEMBLY_ LOAD
1519
1517
ignore tcConfigB
1520
1518
ignore tcImports
1521
1519
ignore fsiDynamicCompiler
1522
1520
ignore fsiConsoleOutput
1523
- ignore rangeStdin
1524
1521
{ new System.IDisposable with
1525
1522
member x.Dispose () = () }
1526
1523
#else
@@ -2317,7 +2314,7 @@ let internal DriveFsiEventLoop (fsi: FsiEvaluationSessionHostConfig, fsiConsoleO
2317
2314
2318
2315
/// The primary type, representing a full F# Interactive session, reading from the given
2319
2316
/// 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 ) =
2321
2318
#if DYNAMIC_ CODE_ REWRITES_ CONSOLE_ WRITE
2322
2319
do
2323
2320
Microsoft.FSharp.Core.Printf.setWriter outWriter
@@ -2457,10 +2454,6 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i
2457
2454
2458
2455
let fsiConsoleInput = FsiConsoleInput( fsi, fsiOptions, inReader, outWriter)
2459
2456
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
-
2464
2457
let ( tcGlobals , frameworkTcImports , nonFrameworkResolutions , unresolvedReferences ) =
2465
2458
try
2466
2459
let tcConfig = tcConfigP.Get()
@@ -2721,8 +2714,12 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i
2721
2714
GC.KeepAlive fsiInterruptController.EventHandlers
2722
2715
2723
2716
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)
2726
2723
2727
2724
static member GetDefaultConfiguration ( fsiObj : obj ) = FsiEvaluationSession.GetDefaultConfiguration( fsiObj, true )
2728
2725
0 commit comments