update
This commit is contained in:
@@ -23,18 +23,19 @@ public static class RoslynAnalysis
|
||||
//Console.WriteLine($"Project: {project.Name}");
|
||||
foreach (var document in project.Documents)
|
||||
{
|
||||
//Console.WriteLine($"Document: {document.Name}");
|
||||
// var compilation = await project.GetCompilationAsync();
|
||||
// Guard.Against.Null(compilation, nameof(compilation));
|
||||
//
|
||||
// // Get diagnostics (built-in or custom analyzers)
|
||||
// var diagnostics = compilation.GetDiagnostics();
|
||||
//
|
||||
// foreach (var diagnostic in diagnostics)
|
||||
// {
|
||||
// Console.WriteLine(diagnostic);
|
||||
// // Optionally run CodeFixProviders here
|
||||
// }
|
||||
Console.WriteLine($"Document: {document.Name}");
|
||||
var compilation = await project.GetCompilationAsync();
|
||||
Guard.Against.Null(compilation, nameof(compilation));
|
||||
|
||||
// Get diagnostics (built-in or custom analyzers)
|
||||
var diagnostics = compilation.GetDiagnostics();
|
||||
var nonHiddenDiagnostics = diagnostics.Where(d => d.Severity is not Microsoft.CodeAnalysis.DiagnosticSeverity.Hidden).ToList();
|
||||
|
||||
foreach (var diagnostic in nonHiddenDiagnostics)
|
||||
{
|
||||
Console.WriteLine(diagnostic);
|
||||
// Optionally run CodeFixProviders here
|
||||
}
|
||||
// var syntaxTree = await document.GetSyntaxTreeAsync();
|
||||
// var root = await syntaxTree!.GetRootAsync();
|
||||
// var classifiedSpans = await Classifier.GetClassifiedSpansAsync(document, root.FullSpan);
|
||||
|
||||
@@ -14,7 +14,6 @@ public static class ProjectEvaluation
|
||||
|
||||
var project = _projectCollection.LoadProject(projectFilePath);
|
||||
Console.WriteLine($"ProjectEvaluation: loaded {project.FullPath}");
|
||||
//var outputType = project.GetProperty("OutputType");
|
||||
return project;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user