Skip to content

Commit 14ef3d0

Browse files
committed
fix load closure
1 parent 52ccde3 commit 14ef3d0

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/fsharp/vs/service.fs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,9 +2614,8 @@ type BackgroundCompiler(referenceResolver, projectCacheSize, keepAssemblyContent
26142614
#endif
26152615
let loadedTimeStamp = defaultArg loadedTimeStamp DateTime.MaxValue // Not 'now', we don't want to force reloading
26162616
let applyCompilerOptions tcConfigB =
2617-
let collect _name = ()
26182617
let fsiCompilerOptions = CompileOptions.GetCoreFsiCompilerOptions tcConfigB
2619-
CompileOptions.ParseCompilerOptions (collect, fsiCompilerOptions, Array.toList otherFlags)
2618+
CompileOptions.ParseCompilerOptions (ignore, fsiCompilerOptions, Array.toList otherFlags)
26202619
let fas = LoadClosure.ComputeClosureOfSourceText(referenceResolver,filename, source, CodeContext.Editing, useSimpleResolution, useFsiAuxLib, new Lexhelp.LexResourceManager(), applyCompilerOptions)
26212620
let otherFlags =
26222621
[| yield "--noframework"; yield "--warn:3";
@@ -3000,7 +2999,7 @@ type FSharpChecker(referenceResolver, projectCacheSize, keepAssemblyContents, ke
30002999
member internal __.FrameworkImportsCache = backgroundCompiler.FrameworkImportsCache
30013000

30023001

3003-
type FsiInteractiveChecker(reactorOps: IReactorOperations, tcConfig, tcGlobals, tcImports, tcState, loadClosure) =
3002+
type FsiInteractiveChecker(referenceResolver, reactorOps: IReactorOperations, tcConfig, tcGlobals, tcImports, tcState) =
30043003
let keepAssemblyContents = false
30053004

30063005
static member CreateErrorInfos (tcConfig, allErrors, mainInputFileName, errors) =
@@ -3015,10 +3014,15 @@ type FsiInteractiveChecker(reactorOps: IReactorOperations, tcConfig, tcGlobals,
30153014
let dependencyFiles = [] // interactions have no dependencies
30163015
let parseResults = FSharpParseFileResults(parseErrors, inputOpt, parseHadErrors = anyErrors, dependencyFiles = dependencyFiles)
30173016

3017+
let applyCompilerOptions tcConfigB =
3018+
let fsiCompilerOptions = CompileOptions.GetCoreFsiCompilerOptions tcConfigB
3019+
CompileOptions.ParseCompilerOptions (ignore, fsiCompilerOptions, [ ])
3020+
3021+
let loadClosure = LoadClosure.ComputeClosureOfSourceText(referenceResolver,mainInputFileName, source, CodeContext.Editing, tcConfig.useSimpleResolution, tcConfig.useFsiAuxLib, new Lexhelp.LexResourceManager(), applyCompilerOptions)
30183022
let backgroundErrors = []
30193023
let tcErrors, tcFileResult =
30203024
Parser.TypeCheckOneFile(parseResults,source,mainInputFileName,"project",tcConfig,tcGlobals,tcImports, tcState,
3021-
loadClosure,backgroundErrors,reactorOps,(fun () -> true),(fun _ -> false),None)
3025+
Some loadClosure,backgroundErrors,reactorOps,(fun () -> true),(fun _ -> false),None)
30223026

30233027
match tcFileResult with
30243028
| Parser.TypeCheckAborted.No scope ->

src/fsharp/vs/service.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ type FSharpChecker =
741741
// An object to typecheck source in a given typechecking environment.
742742
// Used internally to provide intellisense over F# Interactive.
743743
type internal FsiInteractiveChecker =
744-
internal new : ops: IReactorOperations * tcConfig: TcConfig * tcGlobals: TcGlobals * tcImports: TcImports * tcState: TcState * loadClosure: LoadClosure option -> FsiInteractiveChecker
744+
internal new : ReferenceResolver.Resolver * ops: IReactorOperations * tcConfig: TcConfig * tcGlobals: TcGlobals * tcImports: TcImports * tcState: TcState -> FsiInteractiveChecker
745745
member internal ParseAndCheckInteraction : source:string -> FSharpParseFileResults * FSharpCheckFileResults * FSharpCheckProjectResults
746746
static member internal CreateErrorInfos : tcConfig: TcConfig * allErrors:bool * mainInputFileName : string * seq<ErrorLogger.PhasedError * FSharpErrorSeverity> -> FSharpErrorInfo[]
747747

0 commit comments

Comments
 (0)