提交 96e122e0 编写于 作者: H Heejae Chang 提交者: GitHub

Merge pull request #14657 from heejaechang/nullexception

fix null exception happening due to OOP analyzer engine not providing right AnalyzerOptions
......@@ -105,6 +105,14 @@ public void ClearAnalyzerDiagnostics(ImmutableArray<DiagnosticAnalyzer> analyzer
}
}
public void ClearAnalyzerDiagnostics(ProjectId projectId)
{
foreach (var analyzer in _analyzerHostDiagnosticsMap.Keys)
{
ClearAnalyzerDiagnostics(analyzer, projectId);
}
}
private void ClearAnalyzerDiagnostics(DiagnosticAnalyzer analyzer, ProjectId projectId)
{
ImmutableHashSet<DiagnosticData> existing;
......
......@@ -58,6 +58,7 @@
<InternalsVisibleTo Include="MonoDevelop.Refactoring" />
<InternalsVisibleTo Include="MonoDevelop.CSharpBinding" />
<InternalsVisibleTo Include="MonoDevelop.VBNetBinding" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.Remote.Workspaces" />
<InternalsVisibleToTest Include="Roslyn.DebuggerVisualizers" />
<InternalsVisibleTo Include="Roslyn.Hosting.Diagnostics" />
<InternalsVisibleToTest Include="Roslyn.InteractiveHost.UnitTests" />
......
......@@ -98,6 +98,8 @@ public void ClearAllDiagnosticsForProject(ProjectId projectId)
RaiseDiagnosticsRemovedForProject(projectId, key);
}
}
ClearAnalyzerDiagnostics(projectId);
}
public void ClearDiagnosticsForProject(ProjectId projectId, object key)
......
......@@ -44,7 +44,7 @@ public DiagnosticComputer(Project project)
// TODO: can we support analyzerExceptionFilter in remote host?
// right now, host doesn't support watson, we might try to use new NonFatal watson API?
var analyzerOptions = new CompilationWithAnalyzersOptions(
options: _project.AnalyzerOptions,
options: new WorkspaceAnalyzerOptions(_project.AnalyzerOptions, _project.Solution.Workspace),
onAnalyzerException: OnAnalyzerException,
analyzerExceptionFilter: null,
concurrentAnalysis: true,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册