Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We don't ever set the value FCS_RETAIN_BACKGROUND_PARSE_RESULTS #6212

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions src/fsharp/service/IncrementalBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1534,22 +1534,14 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput
let stampedFileNamesNode = Vector.Stamp "SourceFileTimeStamps" StampFileNameTask fileNamesNode
let stampedReferencedAssembliesNode = Vector.Stamp "StampReferencedAssembly" StampReferencedAssemblyTask referencedAssembliesNode
let initialTcAccNode = Vector.Demultiplex "CombineImportedAssemblies" CombineImportedAssembliesTask stampedReferencedAssembliesNode
#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS
let parseTreesNode = Vector.Map "ParseTrees" ParseTask stampedFileNamesNode
let tcStatesNode = Vector.ScanLeft "TypeCheckingStates" TypeCheckTask initialTcAccNode stampedFileNamesNode
#else
let tcStatesNode = Vector.ScanLeft "TypeCheckingStates" (fun ctok tcAcc n -> TypeCheckTask ctok tcAcc (ParseTask ctok n)) initialTcAccNode stampedFileNamesNode
#endif
let finalizedTypeCheckNode = Vector.Demultiplex "FinalizeTypeCheck" FinalizeTypeCheckTask tcStatesNode

// Outputs
let buildDescription = new BuildDescriptionScope ()

do buildDescription.DeclareVectorOutput stampedFileNamesNode
do buildDescription.DeclareVectorOutput stampedReferencedAssembliesNode
#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS
do buildDescription.DeclareVectorOutput parseTreesNode
#endif
do buildDescription.DeclareVectorOutput tcStatesNode
do buildDescription.DeclareScalarOutput initialTcAccNode
do buildDescription.DeclareScalarOutput finalizedTypeCheckNode
Expand Down Expand Up @@ -1712,15 +1704,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput
member builder.GetParseResultsForFile (ctok: CompilationThreadToken, filename) =
cancellable {
let slotOfFile = builder.GetSlotOfFileName filename
#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS
match GetVectorResultBySlot(parseTreesNode, slotOfFile, partialBuild) with
| Some (results, _) -> return results
| None ->
let! build = IncrementalBuild.EvalUpTo ctok SavePartialBuild (parseTreesNode, slotOfFile) partialBuild
match GetVectorResultBySlot(parseTreesNode, slotOfFile, build) with
| Some (results, _) -> return results
| None -> return! failwith "Build was not evaluated, expected the results to be ready after 'Eval' (GetParseResultsForFile)."
#else
let! results =
cancellable {
match GetVectorResultBySlot(stampedFileNamesNode, slotOfFile, partialBuild) with
Expand All @@ -1734,7 +1717,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput
}
// re-parse on demand instead of retaining
return ParseTask ctok results
#endif
}

member __.SourceFiles = sourceFiles |> List.map (fun (_, f, _) -> f)
Expand Down
12 changes: 0 additions & 12 deletions tests/service/ProjectAnalysisTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5179,11 +5179,7 @@ let ``Test request for parse and check doesn't check whole project`` () =
backgroundCheckCount.Value |> shouldEqual 0
let checkResults1 = checker.CheckFileInProject(parseResults1, ProjectBig.fileNames.[5], 0, ProjectBig.fileSources2.[5], ProjectBig.options) |> Async.RunSynchronously
let pD, tD = FSharpChecker.GlobalForegroundParseCountStatistic, FSharpChecker.GlobalForegroundTypeCheckCountStatistic
#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS
backgroundParseCount.Value |> shouldEqual 10
#else
backgroundParseCount.Value |> shouldEqual 5
#endif
backgroundCheckCount.Value |> shouldEqual 5
(pD - pC) |> shouldEqual 0
(tD - tC) |> shouldEqual 1
Expand All @@ -5192,23 +5188,15 @@ let ``Test request for parse and check doesn't check whole project`` () =
let pE, tE = FSharpChecker.GlobalForegroundParseCountStatistic, FSharpChecker.GlobalForegroundTypeCheckCountStatistic
(pE - pD) |> shouldEqual 0
(tE - tD) |> shouldEqual 1
#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS
backgroundParseCount.Value |> shouldEqual 10 // but note, the project does not get reparsed
#else
(backgroundParseCount.Value <= 8) |> shouldEqual true // but note, the project does not get reparsed
#endif
(backgroundCheckCount.Value <= 8) |> shouldEqual true // only two extra typechecks of files

// A subsequent ParseAndCheck of identical source code doesn't do any more anything
let checkResults2 = checker.ParseAndCheckFileInProject(ProjectBig.fileNames.[7], 0, ProjectBig.fileSources2.[7], ProjectBig.options) |> Async.RunSynchronously
let pF, tF = FSharpChecker.GlobalForegroundParseCountStatistic, FSharpChecker.GlobalForegroundTypeCheckCountStatistic
(pF - pE) |> shouldEqual 0 // note, no new parse of the file
(tF - tE) |> shouldEqual 0 // note, no new typecheck of the file
#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS
backgroundParseCount.Value |> shouldEqual 10 // but note, the project does not get reparsed
#else
(backgroundParseCount.Value <= 8) |> shouldEqual true // but note, the project does not get reparsed
#endif
(backgroundCheckCount.Value <= 8) |> shouldEqual true // only two extra typechecks of files

()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4260,12 +4260,8 @@ let x = query { for bbbb in abbbbc(*D0*) do
ReplaceFileInMemory file2 [""]
SaveFileToDisk file2
TakeCoffeeBreak(this.VS)

#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS
gpatcc.AssertExactly(notAA[file2], notAA[file2;file3])
#else

gpatcc.AssertExactly(notAA[file2; file3], notAA[file2;file3])
#endif

/// FEATURE: References added to the project bring corresponding new .NET and F# items into scope.
[<Test;Category("ReproX")>]
Expand Down