未验证 提交 c177d5ce 编写于 作者: W Will Smith 提交者: GitHub

[VS] Use current solution's project state to prevent any cache thrashing (#9121)

* Use current solution's project state to prevent any cache thrashing in FCS

* Update FSharpProjectOptionsManager.fs

* Update FSharpProjectOptionsManager.fs
上级 734d394b
......@@ -240,8 +240,14 @@ type private FSharpProjectOptionsReactor (_workspace: VisualStudioWorkspace, set
let! options = tryComputeOptionsByFile document ct
reply.Reply options
else
let! options = tryComputeOptions document.Project
reply.Reply options
// We only care about the latest project in the workspace's solution.
// We do this to prevent any possible cache thrashing in FCS.
let project = document.Project.Solution.Workspace.CurrentSolution.GetProject(document.Project.Id)
if not (isNull project) then
let! options = tryComputeOptions project
reply.Reply options
else
reply.Reply None
with
| _ ->
reply.Reply None
......@@ -254,8 +260,14 @@ type private FSharpProjectOptionsReactor (_workspace: VisualStudioWorkspace, set
if project.Solution.Workspace.Kind = WorkspaceKind.MiscellaneousFiles || project.Name = FSharpConstants.FSharpMiscellaneousFilesName then
reply.Reply None
else
let! options = tryComputeOptions project
reply.Reply options
// We only care about the latest project in the workspace's solution.
// We do this to prevent any possible cache thrashing in FCS.
let project = project.Solution.Workspace.CurrentSolution.GetProject(project.Id)
if not (isNull project) then
let! options = tryComputeOptions project
reply.Reply options
else
reply.Reply None
with
| _ ->
reply.Reply None
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册