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;
             }
         }
     }
 }
예제 #2
0
 public void RegisterCodeFix(MSBuildAction action, MSBuildDiagnostic diagnostic)
 => reportFix(action, ImmutableArray.Create(diagnostic));
예제 #3
0
 public void RegisterCodeFix(MSBuildAction action, IEnumerable <MSBuildDiagnostic> diagnostics)
 => reportFix(action, ImmutableArray.CreateRange(diagnostics));
예제 #4
0
 public void RegisterCodeFix(MSBuildAction action, ImmutableArray <MSBuildDiagnostic> diagnostics)
 => reportFix(action, diagnostics);