Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async void TestRoslynCompilationWithAnalyzers()
- {
- Compilation compilation = GetSimpleCompilation();
- CompilationWithAnalyzers compilationWithAnalyzers = GetAnalyzerAwareCompilation(compilation);
- ImmutableArray<Diagnostic> diagnosticResults = await compilationWithAnalyzers.GetAllDiagnosticsAsync();
- if (diagnosticResults.Length == 0)
- {
- ImmutableArray<Diagnostic> diagnostics = Compile(compilationWithAnalyzers.Compilation);
- ShowDiagnostics(diagnostics);
- }
- else
- {
- ShowDiagnostics(diagnosticResults);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement