166 types derived from CodeFixProvider
GenerateDocumentationAndConfigFiles (1)
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 (19)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Features (20)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (10)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
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.VisualBasic.Features (7)
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)
445 references to CodeFixProvider
BuildActionTelemetryTable (1)
GenerateDocumentationAndConfigFiles (12)
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.EditorFeatures (3)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (26)
CodeFixes\CodeFixServiceTests.cs (18)
201var codeFixes = ImmutableArray.Create<CodeFixProvider>(codeFix);
262private static Task<ImmutableArray<CodeFixCollection>> GetAddedFixesWithExceptionValidationAsync(CodeFixProvider codefix)
265private static async Task<ImmutableArray<CodeFixCollection>> GetAddedFixesAsync(CodeFixProvider codefix, DiagnosticAnalyzer diagnosticAnalyzer, bool exception = false, bool throwExceptionInFixerCreation = false)
293private static async Task GetFirstDiagnosticWithFixWithExceptionValidationAsync(CodeFixProvider codefix)
312CodeFixProvider codefix,
320ImmutableArray<CodeFixProvider> codefixers,
327new Lazy<CodeFixProvider, CodeChangeProviderMetadata>(
376private static IEnumerable<Lazy<CodeFixProvider, CodeChangeProviderMetadata>> CreateFixers()
377=> [new Lazy<CodeFixProvider, CodeChangeProviderMetadata>(() => new MockFixer(), new CodeChangeProviderMetadata("Test", languages: LanguageNames.CSharp))];
416public readonly ImmutableArray<CodeFixProvider> Fixers;
420private static readonly ImmutableArray<CodeFixProvider> s_defaultFixers = [new MockFixer()];
423public MockAnalyzerReference(ImmutableArray<CodeFixProvider> fixers, ImmutableArray<DiagnosticAnalyzer> analyzers, ImmutableArray<ISourceGenerator> generators)
430public MockAnalyzerReference(ImmutableArray<CodeFixProvider> fixers, ImmutableArray<DiagnosticAnalyzer> analyzers)
435public MockAnalyzerReference(CodeFixProvider? fixer, ImmutableArray<DiagnosticAnalyzer> analyzers)
446public MockAnalyzerReference(CodeFixProvider? fixer)
486public ImmutableArray<CodeFixProvider> GetFixers()
735? SpecializedCollections.SingletonEnumerable(new Lazy<CodeFixProvider, CodeChangeProviderMetadata>(() => vsixFixer, new CodeChangeProviderMetadata(name: nameof(VsixCodeFixProvider), languages: LanguageNames.CSharp)))
846var fixers = ImmutableArray.Create<CodeFixProvider>(fixer1, fixer2, fixer3, fixer4);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (17)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (1)
Microsoft.CodeAnalysis.Features (71)
CodeFixes\Service\CodeFixService.cs (59)
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,
363private bool TryGetWorkspaceFixersMap(TextDocument document, [NotNullWhen(true)] out ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>? fixerMap)
373fixerMap = ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>.Empty;
377using var _ = PooledDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>.GetInstance(out var builder);
389private bool TryGetWorkspaceFixersPriorityMap(TextDocument document, [NotNullWhen(true)] out Lazy<ImmutableDictionary<CodeFixProvider, int>>? fixersPriorityMap)
401Lazy<CodeFixProvider, CodeChangeProviderMetadata> lazyFixer,
404[NotNullWhen(returnValue: true)] out CodeFixProvider? fixer)
463using var _1 = PooledDictionary<CodeFixProvider, List<(TextSpan range, List<DiagnosticData> diagnostics)>>.GetInstance(out var fixerToRangesAndDiagnostics);
464using var _2 = PooledHashSet<CodeFixProvider>.GetInstance(out var currentFixers);
514var diagnosticAndEquivalenceKeyToFixersMap = new Dictionary<(Diagnostic diagnostic, string? equivalenceKey), CodeFixProvider>();
518foreach (var fixer in allFixers)
590ImmutableArray<CodeFixProvider> fixers,
593PooledHashSet<CodeFixProvider> currentFixers,
594PooledDictionary<CodeFixProvider, List<(TextSpan range, List<DiagnosticData> diagnostics)>> fixerToRangesAndDiagnostics)
596foreach (var fixer in fixers)
604private CodeChangeProviderMetadata? TryGetMetadata(CodeFixProvider fixer)
626TextDocument document, TextSpan span, CodeFixProvider fixer, CodeChangeProviderMetadata? fixerMetadata,
629Dictionary<(Diagnostic diagnostic, string? equivalenceKey), CodeFixProvider> diagnosticAndEquivalenceKeyToFixersMap,
666CodeFixProvider fixer,
668Dictionary<(Diagnostic diagnostic, string? equivalenceKey), CodeFixProvider> diagnosticAndEquivalenceKeyToFixersMap)
787var codeFixProvider = (fixer as CodeFixProvider) ?? new WrapperCodeFixProvider((IConfigurationFixProvider)fixer, diagnostics.Select(d => d.Id));
809public CodeFixProvider? GetSuppressionFixer(string language, IEnumerable<string> diagnosticIds)
827private bool IsInteractiveCodeFixProvider(CodeFixProvider provider)
834private ImmutableArray<DiagnosticId> GetFixableDiagnosticIds(CodeFixProvider fixer, IExtensionManager? extensionManager)
861private static ImmutableArray<string> GetAndTestFixableDiagnosticIds(CodeFixProvider codeFixProvider)
869codeFixProvider.GetType().Name + "." + nameof(CodeFixProvider.FixableDiagnosticIds)));
875private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>> GetFixerPerLanguageMap(
878var fixerMap = ImmutableDictionary.Create<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>>();
882var lazyMap = new Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>(() =>
884using var _ = PooledDictionary<DiagnosticId, ArrayBuilder<CodeFixProvider>>.GetInstance(out var mutableMap);
888if (!TryGetWorkspaceFixer(lazyFixer, services, logExceptionWithInfoBar: true, out var fixer))
938private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>> GetFixerPriorityPerLanguageMap(SolutionServices services)
940var languageMap = ImmutableDictionary.CreateBuilder<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>>();
943var lazyMap = new Lazy<ImmutableDictionary<CodeFixProvider, int>>(() =>
945var priorityMap = ImmutableDictionary.CreateBuilder<CodeFixProvider, int>();
950if (!TryGetWorkspaceFixer(fixers[i], services, logExceptionWithInfoBar: false, out var fixer))
965private ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>> GetProjectFixers(TextDocument document)
969? ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>.Empty
973private ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>> ComputeProjectFixers(TextDocument document)
977using var _ = PooledDictionary<DiagnosticId, ArrayBuilder<CodeFixProvider>>.GetInstance(out var builder);
979foreach (var fixer in codeFixProviders)
1001private sealed class FixerComparer : IComparer<CodeFixProvider>
1003private readonly Dictionary<CodeFixProvider, int> _fixerToIndex;
1004private readonly ImmutableDictionary<CodeFixProvider, int> _priorityMap;
1007ImmutableArray<CodeFixProvider> allFixers,
1008ImmutableDictionary<CodeFixProvider, int> priorityMap)
1014public int Compare([AllowNull] CodeFixProvider x, [AllowNull] CodeFixProvider y)
1045public ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>> GetFixerPriorityPerLanguageMap(SolutionServices services)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (40)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (19)
Microsoft.CodeAnalysis.Workspaces (40)
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)