@using System.Collections.Immutable
@using Microsoft.CodeAnalysis
@using SharpIDE.Application.Features.Analysis
@using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence
@if (_diagnostics.Length is not 0)
{
@foreach (var diagnostic in _diagnostics)
{
@diagnostic.GetMessage()
@diagnostic.Id
}
}
@code {
[Parameter, EditorRequired]
public SharpIdeProjectModel ProjectModel { get; set; } = null!;
private ImmutableArray _diagnostics = [];
private static Color GetDiagnosticIconColour(Diagnostic diagnostic) => diagnostic.Severity switch
{
DiagnosticSeverity.Error => Color.Error,
DiagnosticSeverity.Warning => Color.Warning,
DiagnosticSeverity.Info => Color.Info,
_ => Color.Info
};
private async Task OpenDocumentContainingDiagnostic(Diagnostic diagnostic)
{
}
protected override async Task OnInitializedAsync()
{
var diagnostics = await RoslynAnalysis.GetProjectDiagnostics(ProjectModel);
_diagnostics = diagnostics;
}
}