Skip to content

Commit

Permalink
For CPS projects, stop invalidating on document open and document cha…
Browse files Browse the repository at this point in the history
…nged. Also started re-using stamps for options if invalidateConfig was false.
  • Loading branch information
TIHan committed May 12, 2018
1 parent 0b06a7a commit a6fc852
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ type internal FSharpProjectOptionsManager
projectOptionsTable.AddOrUpdateProject(projectId, (fun isRefresh ->
let extraProjectInfo = Some(box workspace)
let tryGetOptionsForReferencedProject f = f |> tryGetOrCreateProjectId |> Option.bind this.TryGetOptionsForProject |> Option.map(fun (_, _, projectOptions) -> projectOptions)
let referencedProjects, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(Settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, site, serviceProvider, (tryGetOrCreateProjectId (site.ProjectFileName)), site.ProjectFileName, extraProjectInfo, Some projectOptionsTable, true)
let useUniqueStamp = invalidateConfig // Do not ask for a unique stamp if we are not invalidating, otherwise it would recompute lots of things, such as assemblies!
let referencedProjects, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(Settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, site, serviceProvider, (tryGetOrCreateProjectId (site.ProjectFileName)), site.ProjectFileName, extraProjectInfo, Some projectOptionsTable, useUniqueStamp)
if invalidateConfig then checkerProvider.Checker.InvalidateConfiguration(projectOptions, startBackgroundCompileIfAlreadySeen = not isRefresh, userOpName = userOpName + ".UpdateProjectInfo")
let referencedProjectIds = referencedProjects |> Array.choose tryGetOrCreateProjectId
let parsingOptions, _ = checkerProvider.Checker.GetParsingOptionsFromProjectOptions(projectOptions)
Expand Down Expand Up @@ -675,7 +676,8 @@ type internal FSharpLanguageService(package : FSharpPackage) =
let fileContents = VsTextLines.GetFileContents(textLines, textViewAdapter)
this.SetupStandAloneFile(filename, fileContents, this.Workspace, hier)
| id ->
projectInfoManager.UpdateProjectInfoWithProjectId(id.ProjectId, "SetupNewTextView", invalidateConfig=true)
// Do not invalidate on document open. We only want to invalidate when the workspace tells us to via, DocumentAdded, DocumentReloaded, etc. - Also when HandleCommandLineChanges gets called.
projectInfoManager.UpdateProjectInfoWithProjectId(id.ProjectId, "SetupNewTextView", invalidateConfig=false)
| _ ->
let fileContents = VsTextLines.GetFileContents(textLines, textViewAdapter)
this.SetupStandAloneFile(filename, fileContents, this.Workspace, hier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ type internal ProjectSitesAndFiles() =
UnresolvedReferences = None
OriginalLoadReferences = []
ExtraProjectInfo=extraProjectInfo
Stamp = if useUniqueStamp then (stamp <- stamp + 1L; Some stamp) else None
Stamp = if useUniqueStamp then (stamp <- stamp + 1L; Some stamp) else Some stamp
}
match projectId, projectOptionsTable with
| Some id, Some optionsTable ->
Expand Down

0 comments on commit a6fc852

Please sign in to comment.