163 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.Analyzers (10)
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
Microsoft.CodeAnalysis.CodeStyle.Fixes (22)
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
39: CodeFixProvider
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (21)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Features (22)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (4)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (10)
Microsoft.CodeAnalysis.Features (26)
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
39: CodeFixProvider
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (3)
Microsoft.CodeAnalysis.Workspaces (1)
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)
Roslyn.Diagnostics.Analyzers (6)
Roslyn.Diagnostics.CSharp.Analyzers (3)
System.Text.RegularExpressions.Generator (1)
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
Text.Analyzers (2)
386 references to CodeFixProvider
BuildActionTelemetryTable (1)
dotnet-format (15)
dotnet-format.UnitTests (2)
GenerateDocumentationAndConfigFiles (9)
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.Analyzers (3)
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (4)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (67)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (10)
Microsoft.CodeAnalysis.CSharp.Features (1)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (82)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (2)
Microsoft.CodeAnalysis.EditorFeatures (3)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (26)
CodeFixes\CodeFixServiceTests.cs (18)
202var codeFixes = ImmutableArray.Create<CodeFixProvider>(codeFix);
263private static Task<ImmutableArray<CodeFixCollection>> GetAddedFixesWithExceptionValidationAsync(CodeFixProvider codefix)
266private static async Task<ImmutableArray<CodeFixCollection>> GetAddedFixesAsync(CodeFixProvider codefix, DiagnosticAnalyzer diagnosticAnalyzer, bool exception = false, bool throwExceptionInFixerCreation = false)
294private static async Task GetFirstDiagnosticWithFixWithExceptionValidationAsync(CodeFixProvider codefix)
313CodeFixProvider codefix,
321ImmutableArray<CodeFixProvider> codefixers,
328new Lazy<CodeFixProvider, CodeChangeProviderMetadata>(
377private static IEnumerable<Lazy<CodeFixProvider, CodeChangeProviderMetadata>> CreateFixers()
378=> [new Lazy<CodeFixProvider, CodeChangeProviderMetadata>(() => new MockFixer(), new CodeChangeProviderMetadata("Test", languages: LanguageNames.CSharp))];
417public readonly ImmutableArray<CodeFixProvider> Fixers;
421private static readonly ImmutableArray<CodeFixProvider> s_defaultFixers = [new MockFixer()];
424public MockAnalyzerReference(ImmutableArray<CodeFixProvider> fixers, ImmutableArray<DiagnosticAnalyzer> analyzers, ImmutableArray<ISourceGenerator> generators)
431public MockAnalyzerReference(ImmutableArray<CodeFixProvider> fixers, ImmutableArray<DiagnosticAnalyzer> analyzers)
436public MockAnalyzerReference(CodeFixProvider? fixer, ImmutableArray<DiagnosticAnalyzer> analyzers)
447public MockAnalyzerReference(CodeFixProvider? fixer)
487public ImmutableArray<CodeFixProvider> GetFixers()
736? SpecializedCollections.SingletonEnumerable(new Lazy<CodeFixProvider, CodeChangeProviderMetadata>(() => vsixFixer, new CodeChangeProviderMetadata(name: nameof(VsixCodeFixProvider), languages: LanguageNames.CSharp)))
847var fixers = ImmutableArray.Create<CodeFixProvider>(fixer1, fixer2, fixer3, fixer4);
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (1)
Microsoft.CodeAnalysis.Features (70)
CodeFixes\Service\CodeFixService.cs (61)
42private readonly ImmutableArray<Lazy<CodeFixProvider, CodeChangeProviderMetadata>> _fixers;
43private readonly Lazy<ImmutableDictionary<string, ImmutableArray<Lazy<CodeFixProvider, CodeChangeProviderMetadata>>>> _fixersPerLanguageMap;
45private readonly ConditionalWeakTable<IReadOnlyList<AnalyzerReference>, ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>> _projectFixersMap = new();
51private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>>? _lazyWorkspaceFixersMap;
52private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>>? _lazyFixerPriorityMap;
54private ImmutableDictionary<CodeFixProvider, ImmutableArray<DiagnosticId>> _fixerToFixableIdsMap = ImmutableDictionary<CodeFixProvider, ImmutableArray<DiagnosticId>>.Empty;
56private ImmutableDictionary<CodeFixProvider, CodeChangeProviderMetadata?> _fixerToMetadataMap = ImmutableDictionary<CodeFixProvider, CodeChangeProviderMetadata?>.Empty;
62[ImportMany] IEnumerable<Lazy<CodeFixProvider, CodeChangeProviderMetadata>> fixers,
87workspaceFixersMap ??= ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>.Empty;
357private bool TryGetWorkspaceFixersMap(TextDocument document, [NotNullWhen(true)] out ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>? fixerMap)
367fixerMap = ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>.Empty;
371using var _ = PooledDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>.GetInstance(out var builder);
383private bool TryGetWorkspaceFixersPriorityMap(TextDocument document, [NotNullWhen(true)] out Lazy<ImmutableDictionary<CodeFixProvider, int>>? fixersPriorityMap)
395Lazy<CodeFixProvider, CodeChangeProviderMetadata> lazyFixer,
398[NotNullWhen(returnValue: true)] out CodeFixProvider? fixer)
457using var _1 = PooledDictionary<CodeFixProvider, List<(TextSpan range, List<DiagnosticData> diagnostics)>>.GetInstance(out var fixerToRangesAndDiagnostics);
458using var _2 = PooledHashSet<CodeFixProvider>.GetInstance(out var currentFixers);
510var diagnosticAndEquivalenceKeyToFixersMap = new Dictionary<(Diagnostic diagnostic, string? equivalenceKey), CodeFixProvider>();
514foreach (var fixer in allFixers)
586ImmutableArray<CodeFixProvider> fixers,
589PooledHashSet<CodeFixProvider> currentFixers,
590PooledDictionary<CodeFixProvider, List<(TextSpan range, List<DiagnosticData> diagnostics)>> fixerToRangesAndDiagnostics)
592foreach (var fixer in fixers)
603async Task<bool> MatchesPriorityAsync(CodeFixProvider codeFixProvider)
635private CodeChangeProviderMetadata? TryGetMetadata(CodeFixProvider fixer)
657TextDocument document, TextSpan span, CodeFixProvider fixer, CodeChangeProviderMetadata? fixerMetadata,
660Dictionary<(Diagnostic diagnostic, string? equivalenceKey), CodeFixProvider> diagnosticAndEquivalenceKeyToFixersMap,
697CodeFixProvider fixer,
699Dictionary<(Diagnostic diagnostic, string? equivalenceKey), CodeFixProvider> diagnosticAndEquivalenceKeyToFixersMap)
814var codeFixProvider = (fixer as CodeFixProvider) ?? new WrapperCodeFixProvider((IConfigurationFixProvider)fixer, diagnostics.Select(d => d.Id));
837public CodeFixProvider? GetSuppressionFixer(string language, IEnumerable<string> diagnosticIds)
855private bool IsInteractiveCodeFixProvider(CodeFixProvider provider)
862private ImmutableArray<DiagnosticId> GetFixableDiagnosticIds(CodeFixProvider fixer, IExtensionManager? extensionManager)
889private static ImmutableArray<string> GetAndTestFixableDiagnosticIds(CodeFixProvider codeFixProvider)
897codeFixProvider.GetType().Name + "." + nameof(CodeFixProvider.FixableDiagnosticIds)));
903private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>> GetFixerPerLanguageMap(
906var fixerMap = ImmutableDictionary.Create<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>>();
910var lazyMap = new Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>(() =>
912using var _ = PooledDictionary<DiagnosticId, ArrayBuilder<CodeFixProvider>>.GetInstance(out var mutableMap);
916if (!TryGetWorkspaceFixer(lazyFixer, services, logExceptionWithInfoBar: true, out var fixer))
966private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>> GetFixerPriorityPerLanguageMap(SolutionServices services)
968var languageMap = ImmutableDictionary.CreateBuilder<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>>();
971var lazyMap = new Lazy<ImmutableDictionary<CodeFixProvider, int>>(() =>
973var priorityMap = ImmutableDictionary.CreateBuilder<CodeFixProvider, int>();
978if (!TryGetWorkspaceFixer(fixers[i], services, logExceptionWithInfoBar: false, out var fixer))
993private ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>> GetProjectFixers(TextDocument document)
997? ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>.Empty
1001private ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>> ComputeProjectFixers(TextDocument document)
1005using var _ = PooledDictionary<DiagnosticId, ArrayBuilder<CodeFixProvider>>.GetInstance(out var builder);
1007foreach (var fixer in codeFixProviders)
1029private sealed class FixerComparer : IComparer<CodeFixProvider>
1031private readonly Dictionary<CodeFixProvider, int> _fixerToIndex;
1032private readonly ImmutableDictionary<CodeFixProvider, int> _priorityMap;
1035ImmutableArray<CodeFixProvider> allFixers,
1036ImmutableDictionary<CodeFixProvider, int> priorityMap)
1042public int Compare([AllowNull] CodeFixProvider x, [AllowNull] CodeFixProvider y)
1073public ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>> GetFixerPriorityPerLanguageMap(SolutionServices services)
Microsoft.CodeAnalysis.NetAnalyzers.UnitTests (2)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (1)
Microsoft.CodeAnalysis.Workspaces (39)
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.MetadataExtractor.Unit.Tests (1)
Microsoft.Gen.Metrics.Unit.Tests (1)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
Microsoft.ML.CodeAnalyzer.Tests (1)
Microsoft.VisualStudio.LanguageServices (3)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (5)
Roslyn.Diagnostics.Analyzers (1)
Test.Utilities (8)
Text.Analyzers (1)