Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public async void TestRoslynCompilationWithAnalyzers()
  2. {
  3. Compilation compilation = GetSimpleCompilation();
  4. CompilationWithAnalyzers compilationWithAnalyzers = GetAnalyzerAwareCompilation(compilation);
  5.  
  6. ImmutableArray<Diagnostic> diagnosticResults = await compilationWithAnalyzers.GetAllDiagnosticsAsync();
  7. if (diagnosticResults.Length == 0)
  8. {
  9. ImmutableArray<Diagnostic> diagnostics = Compile(compilationWithAnalyzers.Compilation);
  10. ShowDiagnostics(diagnostics);
  11. }
  12. else
  13. {
  14. ShowDiagnostics(diagnosticResults);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement