95 types derived from CodeFixProvider
ILLink.CodeFixProvider (2)
Microsoft.Analyzers.Extra (2)
Microsoft.AspNetCore.App.CodeFixes (9)
Microsoft.AspNetCore.Components.Analyzers (1)
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
Microsoft.CodeAnalysis.CodeStyle.Fixes (17)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Features (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (10)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
Microsoft.CodeAnalysis.Features (22)
Microsoft.CodeAnalysis.VisualBasic.Features (7)
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Microsoft.Interop.ComInterfaceGenerator (2)
Microsoft.Interop.LibraryImportGenerator (3)
Microsoft.ML.InternalCodeAnalyzer (2)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
System.Text.RegularExpressions.Generator (1)
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (1)
463 references to CodeFixProvider
BuildActionTelemetryTable (1)
Microsoft.Analyzers.Extra.Tests (4)
Microsoft.Analyzers.Local.Tests (4)
Microsoft.AspNetCore.Analyzer.Testing (1)
Microsoft.AspNetCore.App.Analyzers.Test (1)
Microsoft.AspNetCore.Components.Analyzers.Tests (4)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (4)
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (4)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (19)
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (67)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (10)
Microsoft.CodeAnalysis.CSharp.Features (20)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (82)
Microsoft.CodeAnalysis.EditorFeatures (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (28)
CodeFixes\CodeFixServiceTests.cs (20)
201var codeFixes = ImmutableArray.Create<CodeFixProvider>(codeFix);
278private static Task<ImmutableArray<CodeFixCollection>> GetAddedFixesWithExceptionValidationAsync(CodeFixProvider codefix)
281private static async Task<ImmutableArray<CodeFixCollection>> GetAddedFixesAsync(CodeFixProvider codefix, DiagnosticAnalyzer diagnosticAnalyzer, bool exception = false, bool throwExceptionInFixerCreation = false)
309private static async Task GetFirstDiagnosticWithFixWithExceptionValidationAsync(CodeFixProvider codefix)
328CodeFixProvider codefix,
336ImmutableArray<CodeFixProvider> codefixers,
343new Lazy<CodeFixProvider, CodeChangeProviderMetadata>(
409private static IEnumerable<Lazy<CodeFixProvider, CodeChangeProviderMetadata>> CreateFixers()
410=> [new Lazy<CodeFixProvider, CodeChangeProviderMetadata>(() => new MockFixer(), new CodeChangeProviderMetadata("Test", languages: LanguageNames.CSharp))];
448public readonly ImmutableArray<CodeFixProvider> Fixers;
452private static readonly ImmutableArray<CodeFixProvider> s_defaultFixers = ImmutableArray.Create<CodeFixProvider>(new MockFixer());
455public MockAnalyzerReference(ImmutableArray<CodeFixProvider> fixers, ImmutableArray<DiagnosticAnalyzer> analyzers, ImmutableArray<ISourceGenerator> generators)
462public MockAnalyzerReference(ImmutableArray<CodeFixProvider> fixers, ImmutableArray<DiagnosticAnalyzer> analyzers)
467public MockAnalyzerReference(CodeFixProvider? fixer, ImmutableArray<DiagnosticAnalyzer> analyzers)
468: this(fixer != null ? ImmutableArray.Create(fixer) : ImmutableArray<CodeFixProvider>.Empty,
478public MockAnalyzerReference(CodeFixProvider? fixer)
516public ImmutableArray<CodeFixProvider> GetFixers()
765? SpecializedCollections.SingletonEnumerable(new Lazy<CodeFixProvider, CodeChangeProviderMetadata>(() => vsixFixer, new CodeChangeProviderMetadata(name: nameof(VsixCodeFixProvider), languages: LanguageNames.CSharp)))
877var fixers = ImmutableArray.Create<CodeFixProvider>(fixer1, fixer2, fixer3, fixer4);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (17)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (1)
Microsoft.CodeAnalysis.Features (14)
Microsoft.CodeAnalysis.LanguageServer.Protocol (59)
Features\CodeFixes\CodeFixService.cs (56)
43private readonly ImmutableArray<Lazy<CodeFixProvider, CodeChangeProviderMetadata>> _fixers;
44private readonly ImmutableDictionary<string, ImmutableArray<Lazy<CodeFixProvider, CodeChangeProviderMetadata>>> _fixersPerLanguageMap;
46private readonly ConditionalWeakTable<IReadOnlyList<AnalyzerReference>, ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>> _projectFixersMap = new();
52private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>>? _lazyWorkspaceFixersMap;
53private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>>? _lazyFixerPriorityMap;
55private ImmutableDictionary<CodeFixProvider, ImmutableArray<DiagnosticId>> _fixerToFixableIdsMap = ImmutableDictionary<CodeFixProvider, ImmutableArray<DiagnosticId>>.Empty;
57private ImmutableDictionary<CodeFixProvider, CodeChangeProviderMetadata?> _fixerToMetadataMap = ImmutableDictionary<CodeFixProvider, CodeChangeProviderMetadata?>.Empty;
64[ImportMany] IEnumerable<Lazy<CodeFixProvider, CodeChangeProviderMetadata>> fixers,
356private bool TryGetWorkspaceFixersMap(TextDocument document, [NotNullWhen(true)] out ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>? fixerMap)
366fixerMap = ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>.Empty;
370using var _ = PooledDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>.GetInstance(out var builder);
382private bool TryGetWorkspaceFixersPriorityMap(TextDocument document, [NotNullWhen(true)] out Lazy<ImmutableDictionary<CodeFixProvider, int>>? fixersPriorityMap)
394Lazy<CodeFixProvider, CodeChangeProviderMetadata> lazyFixer,
397[NotNullWhen(returnValue: true)] out CodeFixProvider? fixer)
456using var _1 = PooledDictionary<CodeFixProvider, List<(TextSpan range, List<DiagnosticData> diagnostics)>>.GetInstance(out var fixerToRangesAndDiagnostics);
457using var _2 = PooledHashSet<CodeFixProvider>.GetInstance(out var currentFixers);
507var diagnosticAndEquivalenceKeyToFixersMap = new Dictionary<(Diagnostic diagnostic, string? equivalenceKey), CodeFixProvider>();
582ImmutableArray<CodeFixProvider> fixers,
585PooledHashSet<CodeFixProvider> currentFixers,
586PooledDictionary<CodeFixProvider, List<(TextSpan range, List<DiagnosticData> diagnostics)>> fixerToRangesAndDiagnostics)
588foreach (var fixer in fixers)
596private CodeChangeProviderMetadata? TryGetMetadata(CodeFixProvider fixer)
618TextDocument document, TextSpan span, CodeFixProvider fixer, CodeChangeProviderMetadata? fixerMetadata,
621Dictionary<(Diagnostic diagnostic, string? equivalenceKey), CodeFixProvider> diagnosticAndEquivalenceKeyToFixersMap,
658CodeFixProvider fixer,
660Dictionary<(Diagnostic diagnostic, string? equivalenceKey), CodeFixProvider> diagnosticAndEquivalenceKeyToFixersMap)
779var codeFixProvider = (fixer as CodeFixProvider) ?? new WrapperCodeFixProvider((IConfigurationFixProvider)fixer, diagnostics.Select(d => d.Id));
801public CodeFixProvider? GetSuppressionFixer(string language, IEnumerable<string> diagnosticIds)
819private bool IsInteractiveCodeFixProvider(CodeFixProvider provider)
826private ImmutableArray<DiagnosticId> GetFixableDiagnosticIds(CodeFixProvider fixer, IExtensionManager? extensionManager)
853private static ImmutableArray<string> GetAndTestFixableDiagnosticIds(CodeFixProvider codeFixProvider)
861codeFixProvider.GetType().Name + "." + nameof(CodeFixProvider.FixableDiagnosticIds)));
867private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>> GetFixerPerLanguageMap(
870var fixerMap = ImmutableDictionary.Create<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>>();
874var lazyMap = new Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>(() =>
876using var _ = PooledDictionary<DiagnosticId, ArrayBuilder<CodeFixProvider>>.GetInstance(out var mutableMap);
880if (!TryGetWorkspaceFixer(lazyFixer, services, logExceptionWithInfoBar: true, out var fixer))
930private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>> GetFixerPriorityPerLanguageMap(SolutionServices services)
932var languageMap = ImmutableDictionary.CreateBuilder<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>>();
935var lazyMap = new Lazy<ImmutableDictionary<CodeFixProvider, int>>(() =>
937var priorityMap = ImmutableDictionary.CreateBuilder<CodeFixProvider, int>();
942if (!TryGetWorkspaceFixer(fixers[i], services, logExceptionWithInfoBar: false, out var fixer))
957private ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>> GetProjectFixers(TextDocument document)
961? ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>.Empty
965private ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>> ComputeProjectFixers(TextDocument document)
969using var _ = PooledDictionary<DiagnosticId, ArrayBuilder<CodeFixProvider>>.GetInstance(out var builder);
993private sealed class FixerComparer : IComparer<CodeFixProvider>
995private readonly Dictionary<CodeFixProvider, int> _fixerToIndex;
996private readonly ImmutableDictionary<CodeFixProvider, int> _priorityMap;
999ImmutableArray<CodeFixProvider> allFixers,
1000ImmutableDictionary<CodeFixProvider, int> priorityMap)
1006public int Compare([AllowNull] CodeFixProvider x, [AllowNull] CodeFixProvider y)
1037public ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>> GetFixerPriorityPerLanguageMap(SolutionServices services)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (40)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (19)
Microsoft.CodeAnalysis.Workspaces (41)
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
Microsoft.Gen.Logging.Unit.Tests (1)
Microsoft.Gen.Metrics.Unit.Tests (1)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
Microsoft.ML.CodeAnalyzer.Tests (1)
Microsoft.VisualStudio.LanguageServices (1)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (6)