提交 14606d77 编写于 作者: M Manish Vasani

Use current solution for options.

上级 014ac5c4
......@@ -209,10 +209,11 @@ public void Reanalyze(IIncrementalAnalyzer analyzer, ReanalyzeScope scope, bool
private void OnActiveDocumentChanged(object sender, DocumentId activeDocumentId)
{
IAsyncToken asyncToken;
if (SolutionCrawlerOptions.GetBackgroundAnalysisScope(_registration.Workspace.Options) == BackgroundAnalysisScope.ActiveFile &&
var solution = _registration.Workspace.CurrentSolution;
if (SolutionCrawlerOptions.GetBackgroundAnalysisScope(solution.Options) == BackgroundAnalysisScope.ActiveFile &&
activeDocumentId != null)
{
var activeDocument = _registration.Workspace.CurrentSolution.GetDocument(activeDocumentId);
var activeDocument = solution.GetDocument(activeDocumentId);
if (activeDocument != null)
{
lock (_gate)
......@@ -226,8 +227,8 @@ private void OnActiveDocumentChanged(object sender, DocumentId activeDocumentId)
_lastActiveDocument = activeDocument;
}
asyncToken = _listener.BeginAsyncOperation("OnDocumentChanged");
EnqueueEvent(activeDocument.Project.Solution, activeDocument.Id, InvocationReasons.DocumentChanged, asyncToken);
asyncToken = _listener.BeginAsyncOperation("OnDocumentOpened");
EnqueueEvent(activeDocument.Project.Solution, activeDocument.Id, InvocationReasons.DocumentOpened, asyncToken);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册