public MSBuildCodeFix(MSBuildAction action, ImmutableArray <MSBuildDiagnostic> diagnostics) { Action = action; Diagnostics = diagnostics; if (diagnostics == null || diagnostics.Length == 0) { Category = PredefinedSuggestedActionCategoryNames.Refactoring; } else { Category = PredefinedSuggestedActionCategoryNames.CodeFix; foreach (var d in diagnostics) { if (d.Descriptor.Severity == MSBuildDiagnosticSeverity.Error) { Category = PredefinedSuggestedActionCategoryNames.ErrorFix; break; } } } }
public void RegisterCodeFix(MSBuildAction action, MSBuildDiagnostic diagnostic) => reportFix(action, ImmutableArray.Create(diagnostic));
public void RegisterCodeFix(MSBuildAction action, IEnumerable <MSBuildDiagnostic> diagnostics) => reportFix(action, ImmutableArray.CreateRange(diagnostics));
public void RegisterCodeFix(MSBuildAction action, ImmutableArray <MSBuildDiagnostic> diagnostics) => reportFix(action, diagnostics);