56 types derived from CodeAction
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
AddResponseTypeAttributeCodeFixAction.cs (1)
30internal sealed class AddResponseTypeAttributeCodeFixAction : CodeAction
ApiActionsDoNotRequireExplicitModelValidationCodeFixProvider.cs (1)
37private sealed class MyCodeAction : CodeAction
Microsoft.CodeAnalysis.Analyzers (3)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.FixAllProvider.cs (2)
73private sealed class FixAllAdditionalDocumentChangeAction : CodeAction 159private sealed class FixAllAddAdditionalDocumentsAction : CodeAction
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.CustomFixAllProvider.cs (1)
81private sealed class FixAllAdditionalDocumentChangeAction : CodeAction
Microsoft.CodeAnalysis.CodeStyle.Fixes (8)
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (1)
22ImmutableArray<IMethodSymbol> constructors) : CodeAction
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (1)
17private sealed partial class GenerateEnumMemberCodeAction(Document document, State state) : CodeAction
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (1)
15private sealed partial class GenerateParameterizedMemberCodeAction : CodeAction
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (1)
20private sealed partial class GenerateVariableCodeAction : CodeAction
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
18private sealed class GenerateLocalCodeAction(TService service, Document document, State state) : CodeAction
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateParameterCodeAction.cs (1)
21int parameterIndex) : CodeAction
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
111private sealed class FixNameCodeAction : CodeAction
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
99internal sealed class ProjectOptionsChangeAction : CodeAction
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
CodeActions\ApplyChangesOperationTests.cs (1)
41private sealed class TestCodeAction : CodeAction
CodeActions\Preview\ErrorCases\ExceptionInCodeAction.cs (1)
24internal sealed class ExceptionCodeAction : CodeAction
CodeActions\PreviewTests.cs (1)
52private sealed class TestCodeAction : CodeAction
Microsoft.CodeAnalysis.CSharp.Features (1)
Copilot\CSharpCopilotCodeFixProvider.DismissChangesCodeAction.cs (1)
21private sealed class CopilotDismissChangesCodeAction(SyntaxNode originalMethodNode, Diagnostic diagnostic) : CodeAction
Microsoft.CodeAnalysis.EditorFeatures (3)
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCodeAction.cs (1)
24private sealed class RenameTrackingCodeAction : CodeAction
Suggestions\PreviewChanges\PreviewChangesCodeAction.cs (1)
18private sealed class PreviewChangesCodeAction : CodeAction
Suggestions\RefineUsingCopilot\RefineUsingCopilotCodeAction.cs (1)
32ICopilotCodeAnalysisService copilotCodeAnalysisService) : CodeAction
Microsoft.CodeAnalysis.Features (22)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (1)
31bool useSubMenuName) : CodeAction
AddImport\CodeActions\AddImportCodeAction.cs (1)
19internal abstract class AddImportCodeAction : CodeAction
AddImport\CodeActions\InstallWithPackageManagerCodeAction.cs (1)
18string packageName) : CodeAction
AddMissingReference\AddMissingReferenceCodeAction.cs (1)
15internal sealed class AddMissingReferenceCodeAction(Project project, string title, ProjectReference? projectReferenceToAdd, AssemblyIdentity missingAssemblyIdentity) : CodeAction
AddPackage\InstallPackageDirectlyCodeAction.cs (1)
21bool isLocal) : CodeAction
AddPackage\InstallWithPackageManagerCodeAction.cs (1)
15IPackageInstallerService installerService, string packageName) : CodeAction
CodeFixes\Suppression\NestedSuppressionCodeAction.cs (1)
9internal abstract class NestedSuppressionCodeAction : CodeAction
CodeFixesAndRefactorings\AbstractFixAllCodeAction.cs (1)
19IFixAllState fixAllState, bool showPreviewChangesDialog) : CodeAction
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeCodeAction.cs (1)
15private sealed class MoveTypeCodeAction : CodeAction
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
26private sealed class MoveFileCodeAction(State state, ImmutableArray<string> newFolders) : CodeAction
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.ConstructorDelegatingCodeAction.cs (1)
25bool addNullChecks) : CodeAction
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.FieldDelegatingCodeAction.cs (1)
25bool addNullChecks) : CodeAction
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (1)
29bool generateOperators) : CodeAction
GenerateType\AbstractGenerateTypeService.CodeAction.cs (1)
21private sealed class GenerateTypeCodeAction : CodeAction
IntroduceVariable\AbstractIntroduceVariableService.IntroduceVariableCodeAction.cs (1)
17private sealed class IntroduceVariableCodeAction : CodeAction
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (1)
22ImmutableArray<IMethodSymbol> constructors) : CodeAction
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (1)
17private sealed partial class GenerateEnumMemberCodeAction(Document document, State state) : CodeAction
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (1)
15private sealed partial class GenerateParameterizedMemberCodeAction : CodeAction
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (1)
20private sealed partial class GenerateVariableCodeAction : CodeAction
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
18private sealed class GenerateLocalCodeAction(TService service, Document document, State state) : CodeAction
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateParameterCodeAction.cs (1)
21int parameterIndex) : CodeAction
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
111private sealed class FixNameCodeAction : CodeAction
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (4)
AnnotatePublicApiFix.cs (1)
103private class FixAllAdditionalDocumentChangeAction : CodeAction
DeclarePublicApiFix.cs (2)
200internal class AdditionalDocumentChangeAction : CodeAction 221private class FixAllAdditionalDocumentChangeAction : CodeAction
NullableEnablePublicApiFix.cs (1)
71private class FixAllAdditionalDocumentChangeAction : CodeAction
Microsoft.CodeAnalysis.VisualBasic.Features (8)
CodeFixes\CorrectNextControlVariable\CorrectNextControlVariableCodeFixProvider.CodeAction.vb (1)
11Inherits CodeAction
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.CodeAction.vb (1)
12Inherits CodeAction
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.AddKeywordCodeAction.vb (1)
13Inherits CodeAction
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.ReplaceKeywordCodeAction.vb (1)
13Inherits CodeAction
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.ReplaceTokenKeywordCodeAction.vb (1)
12Inherits CodeAction
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.MoveToLineCodeAction.vb (1)
12Inherits CodeAction
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.AddKeywordAction.vb (1)
15Inherits CodeAction
CodeRefactorings\RemoveStatementCodeAction.vb (1)
11Inherits CodeAction
Microsoft.CodeAnalysis.Workspaces (2)
CodeActions\CodeAction.cs (1)
580bool createdFromFactoryMethod) : CodeAction
CodeActions\CodeActionWithOptions.cs (1)
19public abstract class CodeActionWithOptions : CodeAction
1199 references to CodeAction
AnalyzerRunner (2)
CodeRefactoringRunner.cs (2)
88var codeActions = new List<CodeAction>(); 92foreach (var codeAction in codeActions)
BuildActionTelemetryTable (1)
Program.cs (1)
119static bool IsCodeActionType(Type t) => typeof(CodeAction).IsAssignableFrom(t);
GenerateDocumentationAndConfigFiles (7)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\CodeFixContextExtensions.cs (4)
16internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, Diagnostic diagnostic) 18foreach (var action in actions) 27internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, ImmutableArray<Diagnostic> diagnostics) 31foreach (var action in actions)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
58=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey), context.Diagnostics); 61=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey, priority), context.Diagnostics);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringContextExtensions.cs (1)
22where TCodeAction : CodeAction
ILLink.CodeFixProvider (2)
BaseAttributeCodeFixProvider.cs (1)
46context.RegisterCodeFix(CodeAction.Create(
DynamicallyAccessedMembersCodeFixProvider.cs (1)
108context.RegisterCodeFix(CodeAction.Create(
Microsoft.Analyzers.Extra (3)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
62CodeAction.Create(
MakeExeTypesInternalFixer.cs (2)
32var action = CodeAction.Create(Resources.MakeTypeInternal, c => MakeInternalAsync(context.Document, node, context.CancellationToken), nameof(MakeExeTypesInternalFixer));
Microsoft.Analyzers.Extra.Tests (2)
Resources\RoslynTestUtils.cs (2)
342var actions = new List<CodeAction>(); 451var fixAllCodeAction = await fixAllProvider!.GetFixAsync(context);
Microsoft.Analyzers.Local.Tests (2)
Resources\RoslynTestUtils.cs (2)
343var actions = new List<CodeAction>(); 452var fixAllCodeAction = await fixAllProvider!.GetFixAsync(context);
Microsoft.AspNetCore.Analyzer.Testing (2)
CodeFixRunner.cs (2)
28var actions = new List<CodeAction>(); 61private static async Task<Solution> ApplyFixAsync(CodeAction codeAction)
Microsoft.AspNetCore.App.Analyzers.Test (2)
Dependencies\AddPackageTests.cs (2)
72internal override Task<CodeAction> TryCreateCodeActionAsync( 80return Task.FromResult<CodeAction>(null);
Microsoft.AspNetCore.App.CodeFixes (12)
Authorization\AddAuthorizationBuilderFixer.cs (1)
47CodeAction.Create(title,
Dependencies\AddPackageFixer.cs (3)
89var codeAction = await TryCreateCodeActionAsync( 112internal virtual async Task<CodeAction?> TryCreateCodeActionAsync( 118var codeAction = await AspNetCoreAddPackageCodeAction.TryCreateCodeActionAsync(
DetectMismatchedParameterOptionalityFixer.cs (1)
28CodeAction.Create("Fix mismatched route parameter and argument optionality",
Http\HeaderDictionaryAddFixer.cs (2)
50CodeAction.Create(appendTitle, 60CodeAction.Create(indexerTitle,
Http\HeaderDictionaryIndexerFixer.cs (1)
32CodeAction.Create(title,
Kestrel\ListenOnIPv6AnyFixer.cs (1)
29CodeAction.Create(
PublicPartialProgramClassFixer.cs (1)
28CodeAction.Create("Remove unnecessary public partial class Program declaration",
RouteParameterUnusedParameterFixer.cs (1)
50CodeAction.Create($"Add parameter '{routeParameterName}'",
WebApplicationBuilderFixer.cs (1)
68CodeAction.Create(
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
43CodeAction.Create(
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Helpers\CodeFixVerifier.Helper.cs (1)
26private static Document ApplyFix(Document document, CodeAction codeAction)
Verifiers\CodeFixVerifier.cs (1)
85var actions = new List<CodeAction>();
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
43CodeAction.Create(
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
Helpers\CodeFixVerifier.Helper.cs (1)
26private static Document ApplyFix(Document document, CodeAction codeAction)
Verifiers\CodeFixVerifier.cs (1)
85var actions = new List<CodeAction>();
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
AddResponseTypeAttributeCodeFixAction.cs (1)
20/// A <see cref="CodeAction"/> that adds one or more <c>ProducesResponseType</c> attributes on the action.
Microsoft.CodeAnalysis.Analyzers (26)
FixAnalyzers\FixerWithFixAllAnalyzer.cs (2)
153/// Map of invocations from code fix providers to invocations that create a code action using the static "Create" methods on <see cref="CodeAction"/>. 158/// Map of invocations from code fix providers to object creations that create a code action using sub-types of <see cref="CodeAction"/>.
FixAnalyzers\FixerWithFixAllAnalyzer.Fixer.cs (1)
54context.RegisterCodeFix(CodeAction.Create(title, c => AddMethodAsync(context.Document, classDecl, c), equivalenceKey: title), context.Diagnostics);
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (5)
52CodeAction? codeAction = null; 58codeAction = CodeAction.Create( 69codeAction = CodeAction.Create( 76codeAction = CodeAction.Create( 85codeAction = CodeAction.Create(
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.FixAllProvider.cs (1)
25public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
MetaAnalyzers\Fixers\ApplyDiagnosticAnalyzerAttributeFix.cs (2)
55var fix = CodeAction.Create(
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (2)
44CodeAction.Create( 52CodeAction.Create(
MetaAnalyzers\Fixers\ConfigureGeneratedCodeAnalysisFix.cs (1)
33CodeAction.Create(
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.cs (2)
69var codeAction = CodeAction.Create(
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.CustomFixAllProvider.cs (1)
30public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
MetaAnalyzers\Fixers\EnableConcurrentExecutionFix.cs (1)
32CodeAction.Create(
MetaAnalyzers\Fixers\PreferIsKindFix.cs (1)
27CodeAction.Create(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\CodeFixContextExtensions.cs (4)
16internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, Diagnostic diagnostic) 18foreach (var action in actions) 27internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, ImmutableArray<Diagnostic> diagnostics) 31foreach (var action in actions)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
58=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey), context.Diagnostics); 61=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey, priority), context.Diagnostics);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringContextExtensions.cs (1)
22where TCodeAction : CodeAction
Microsoft.CodeAnalysis.Analyzers.UnitTests (2)
FixAnalyzers\FixerWithFixAllAnalyzerTests.cs (2)
749return VerifyCS.Diagnostic(FixerWithFixAllAnalyzer.OverrideCodeActionEquivalenceKeyRule).WithLocation(line, column).WithArguments(customCodeActionName, nameof(CodeAction.EquivalenceKey)); 756return VerifyVB.Diagnostic(FixerWithFixAllAnalyzer.OverrideCodeActionEquivalenceKeyRule).WithLocation(line, column).WithArguments(customCodeActionName, nameof(CodeAction.EquivalenceKey));
Microsoft.CodeAnalysis.BannedApiAnalyzers (7)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\CodeFixContextExtensions.cs (4)
16internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, Diagnostic diagnostic) 18foreach (var action in actions) 27internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, ImmutableArray<Diagnostic> diagnostics) 31foreach (var action in actions)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
58=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey), context.Diagnostics); 61=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey, priority), context.Diagnostics);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringContextExtensions.cs (1)
22where TCodeAction : CodeAction
Microsoft.CodeAnalysis.CodeStyle.Fixes (92)
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (1)
45CodeAction.Create(
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (3)
90using var actions = TemporaryArray<CodeAction>.Empty; 97actions.Add(CodeAction.Create( 112CodeAction.Create(AnalyzersResources.Add_explicit_cast, actions.ToImmutableAndClear(), isInlinable: false),
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (12)
256ImmutableArray<CodeAction> NestByOverload() 258var builder = new FixedSizeArrayBuilder<CodeAction>(codeFixData.Length); 263var codeAction = CodeAction.Create( 274codeAction = CodeAction.Create( 278CodeAction.Create( 293ImmutableArray<CodeAction> NestByCascading() 295using var builder = TemporaryArray<CodeAction>.Empty; 300return CodeAction.Create(title, data.CreateChangedSolutionNonCascading, equivalenceKey: title); 308return CodeAction.Create(title, data.CreateChangedSolutionCascading!, equivalenceKey: title); 316builder.Add(CodeAction.Create(nestedNonCascadingTitle, nonCascadingActions, isInlinable: false)); 323builder.Add(CodeAction.Create(nestedCascadingTitle, cascadingActions, isInlinable: false));
src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (1)
34CodeAction.Create(
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (3)
52using var _ = ArrayBuilder<CodeAction>.GetInstance(out var actions); 58actions.Add(CodeAction.Create( 70CodeAction.Create(
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (3)
301static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey) 303var codeAction = CodeAction.Create(title, action, equivalenceKey, CodeActionPriority.High);
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (3)
29var codeAction = await GetCodeActionAsync( 51private async Task<CodeAction?> GetCodeActionAsync( 62return CodeAction.Create(
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
41CodeAction.Create(
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
40CodeAction.Create(
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
35CodeAction.Create(
src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (2)
53var codeAction = CodeAction.Create(
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (5)
80public async Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 91using var result = TemporaryArray<CodeAction>.Empty; 96result.Add(CodeAction.Create( 105result.Add(CodeAction.Create( 112result.Add(CodeAction.Create(
src\Analyzers\Core\CodeFixes\GenerateConstructor\IGenerateConstructorService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.cs (2)
25public async Task<ImmutableArray<CodeAction>> GenerateDefaultConstructorsAsync( 35using var _ = ArrayBuilder<CodeAction>.GetInstance(out var result);
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\IGenerateDefaultConstructorsService.cs (1)
16Task<ImmutableArray<CodeAction>> GenerateDefaultConstructorsAsync(
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.cs (1)
25public async Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateEnumMember\IGenerateEnumMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (1)
25protected abstract Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (1)
27public async Task<ImmutableArray<CodeAction>> GenerateConversionAsync(
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.cs (1)
23public async Task<ImmutableArray<CodeAction>> GenerateDeconstructMethodAsync(
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.cs (1)
28public async Task<ImmutableArray<CodeAction>> GenerateMethodAsync(
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (2)
36protected async ValueTask<ImmutableArray<CodeAction>> GetActionsAsync(Document document, State state, CancellationToken cancellationToken) 38using var _ = ArrayBuilder<CodeAction>.GetInstance(out var result);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateConversionService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateConversionAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateDeconstructMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateDeconstructMethodAsync(
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateParameterizedMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateMethodAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (9)
32public async Task<ImmutableArray<CodeAction>> GenerateVariableAsync( 45using var _ = ArrayBuilder<CodeAction>.GetInstance(out var actions); 73return [CodeAction.Create( 87ArrayBuilder<CodeAction> result, SemanticDocument document, State state, CancellationToken cancellationToken) 130private static void GenerateWritableProperty(ArrayBuilder<CodeAction> result, SemanticDocument document, State state) 137private static void AddFieldCodeActions(ArrayBuilder<CodeAction> result, SemanticDocument document, State state) 169private static void GenerateWriteableField(ArrayBuilder<CodeAction> result, SemanticDocument document, State state) 176ArrayBuilder<CodeAction> result, Document document, State state, CancellationToken cancellationToken) 192ArrayBuilder<CodeAction> result, Document document, State state, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateVariable\IGenerateVariableService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateVariableAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (2)
46CodeAction.Create( 60CodeAction.Create(
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (2)
54using var _ = ArrayBuilder<CodeAction>.GetInstance(out var codeActions); 59codeActions.Add(CodeAction.Create(
src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (2)
17protected abstract Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken); 28var codeAction = await GetCodeFixAsync(root, node, context.Document, diagnostic, context.CancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
67CodeAction.Create( 78CodeAction.Create(
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
39CodeAction.Create(
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
31CodeAction.Create(
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (2)
28public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext) 42return CodeAction.Create(
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
33context.RegisterCodeFix(CodeAction.Create(
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
33context.RegisterCodeFix(CodeAction.Create(
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (3)
66CodeAction.Create( 78CodeAction.Create( 90CodeAction.Create(
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
55CodeAction.Create(
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (1)
34CodeAction.Create(
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
48CodeAction.Create(
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (3)
15using static Microsoft.CodeAnalysis.CodeActions.CodeAction; 41protected ImmutableArray<CodeAction> GetUpgradeProjectCodeActions(CodeFixContext context) 47var result = new List<CodeAction>();
src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (1)
42CodeAction.Create(title, GetDocumentUpdater(context), title),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\CodeFixContextExtensions.cs (4)
16internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, Diagnostic diagnostic) 18foreach (var action in actions) 27internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, ImmutableArray<Diagnostic> diagnostics) 31foreach (var action in actions)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
58=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey), context.Diagnostics); 61=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey, priority), context.Diagnostics);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringContextExtensions.cs (1)
22where TCodeAction : CodeAction
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (9)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeFixVerifier`2+Test.cs (3)
83public Action<ImmutableArray<CodeAction>>? CodeActionsVerifier { get; set; } 114protected override ImmutableArray<CodeAction> FilterCodeActions(ImmutableArray<CodeAction> actions)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeRefactoringVerifier`1+Test.cs (3)
79/// The set of code action <see cref="CodeAction.Title"/>s offered the user in this exact order. 90protected override ImmutableArray<CodeAction> FilterCodeActions(ImmutableArray<CodeAction> actions)
src\Features\DiagnosticsTestUtilities\CodeActions\VisualBasicCodeRefactoringVerifier`1+Test.cs (3)
71/// The set of code action <see cref="CodeAction.Title"/>s offered the user in this exact order. 82protected override ImmutableArray<CodeAction> FilterCodeActions(ImmutableArray<CodeAction> actions)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (37)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAtStartCodeFixProvider.cs (1)
48CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (2)
42var documentChangeAction = CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (1)
44CodeAction.Create(title, GetDocumentUpdater(context), equivalenceKey),
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (3)
33public static async Task<CodeAction?> GetCodeActionAsync( 66var positional = CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\CSharpConvertToRecordCodeFixProvider.cs (1)
43var action = await ConvertToRecordEngine.GetCodeActionAsync(
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (1)
40protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.cs (1)
31protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (1)
57protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (1)
80protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
47protected override async Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (1)
51context.RegisterCodeFix(CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (2)
45protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken) 82return CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
36protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken) 107return CodeAction.Create(title, _ => Task.FromResult(newDocument), title);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
41CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
55CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
77CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
35CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
35CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
36CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
35CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
38CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (2)
40CodeAction.Create( 47CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (1)
47CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (1)
49CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
34CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
55CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
53CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
45CodeAction.Create(title, GetDocumentUpdater(context), title),
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
70CodeAction.Create( 84CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
51CodeAction.Create(
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (6)
src\Analyzers\CSharp\Tests\AddExplicitCast\AddExplicitCastTests.cs (2)
25protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
src\Analyzers\CSharp\Tests\AddParameter\AddParameterTests.cs (2)
28protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
src\Analyzers\CSharp\Tests\AliasAmbiguousType\AliasAmbiguousTypeTests.cs (2)
27protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (34)
CodeActions\AddUsing\AddUsingNuGetTests.cs (2)
47protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
CodeActions\ApplyChangesOperationTests.cs (2)
233var refactorings = new List<CodeAction>(); 238var action = refactorings.Single();
CodeActions\GenerateType\GenerateTypeTests.cs (2)
32protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> codeActions)
CodeActions\GenerateType\GenerateTypeWithUnboundAnalyzerTests.cs (2)
31protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> codeActions)
CodeActions\ImplementInterface\ImplementExplicitlyTests.cs (2)
27protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
CodeActions\ImplementInterface\ImplementImplicitlyTests.cs (2)
29protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
CodeActions\PreviewExceptionTests.cs (3)
92var codeActions = new List<CodeAction>(); 102EditorTestWorkspace workspace, CodeRefactoringProvider provider, List<CodeAction> codeActions, 112var action = codeActions.Single();
CodeActions\PreviewTests.cs (2)
96var refactorings = new List<CodeAction>(); 99var action = refactorings.Single();
CodeActions\PullMemberUp\CSharpPullMemberUpTests.cs (2)
33protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions) => FlattenActions(actions);
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (6)
99var renameFileAction = actions.Any(action => action is not CodeAction.SolutionChangeAction); 113var moveFileActions = actions.Where(a => a is not CodeAction.SolutionChangeAction); 115foreach (var action in moveFileActions) 213var hasChangeNamespaceAction = actions.Any(action => action is CodeAction.SolutionChangeAction); 222var changeNamespaceAction = actions.Single(a => a is CodeAction.SolutionChangeAction);
Diagnostics\FixAllProvider\BatchFixerTests.cs (2)
88var fix = CodeAction.Create("QualifyWithThisFix", _ => Task.FromResult(newDocument));
Formatting\CodeCleanupTests.TestFixers.cs (7)
28CodeAction.Create( 85public override Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext) 88return Task.FromResult<CodeAction?>(CodeAction.Create( 141public override Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext) 144return Task.FromResult<CodeAction?>(CodeAction.Create(
Microsoft.CodeAnalysis.CSharp.Features (92)
CodeFixes\GenerateType\GenerateTypeCodeFixProvider.cs (1)
50protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
59CodeAction.Create(
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
267: CodeAction.SolutionChangeAction(
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.FixAllProvider.cs (3)
34public override Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext) 37return Task.FromResult<CodeAction?>(new FixAllCodeAction(EnableNullableReferenceTypesInSolutionAsync)); 57: CodeAction.SolutionChangeAction(
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
93CodeAction.Create(
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (1)
64CodeAction.Create(
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
66CodeAction.Create(
ConvertBetweenRegularAndVerbatimString\AbstractConvertBetweenRegularAndVerbatimStringCodeRefactoringProvider.cs (2)
63context.RegisterRefactoring(CodeAction.Create( 73context.RegisterRefactoring(CodeAction.Create(
ConvertNamespace\ConvertNamespaceCodeRefactoringProvider.cs (1)
55context.RegisterRefactoring(CodeAction.Create(
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
64context.RegisterRefactoring(CodeAction.Create(
ConvertProgram\ConvertToProgramMainCodeRefactoringProvider.cs (1)
56context.RegisterRefactoring(CodeAction.Create(
ConvertProgram\ConvertToTopLevelStatementsCodeRefactoringProvider.cs (1)
59context.RegisterRefactoring(CodeAction.Create(
ConvertToExtension\ConvertToExtensionCodeRefactoringProvider.cs (2)
166context.RegisterRefactoring(CodeAction.Create( 183context.RegisterRefactoring(CodeAction.Create(
ConvertToRawString\ConvertStringToRawStringCodeRefactoringProvider.cs (3)
97CodeAction.Create( 107CodeAction.Create( 117CodeAction.Create(
ConvertToRecord\CSharpConvertToRecordRefactoringProvider.cs (1)
27var action = await ConvertToRecordEngine.GetCodeActionAsync(
Copilot\CSharpCopilotCodeFixProvider.cs (2)
82var fix = TryGetFix(document, containingMethod, diagnostic, hasMultiplePrompts); 89private static CodeAction? TryGetFix(
Copilot\CSharpCopilotCodeFixProvider.DocumentChangeCodeAction.cs (2)
26CodeActionPriority priority) : CodeAction.DocumentChangeAction(title, createChangedDocument, equivalenceKey, priority) 28internal sealed override ImmutableArray<CodeAction> AdditionalPreviewFlavors { get; } = [dismissChangesCodeAction];
Copilot\CSharpImplementNotImplementedExceptionFixProvider.cs (1)
23using static Microsoft.CodeAnalysis.CodeActions.CodeAction;
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (6)
79var codeAction = CodeAction.Create( 105using var nestedActions = TemporaryArray<CodeAction>.Empty; 111nestedActions.Add(CodeAction.Create( 119nestedActions.Add(CodeAction.Create( 125context.RegisterRefactoring(CodeAction.Create(
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (10)
133static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Solution>> createSolution) 134=> CodeAction.Create(title, createSolution, title); 136IEnumerable<CodeAction> HandleExistingFieldOrProperty() 144IEnumerable<CodeAction> HandleNoExistingFieldOrProperty() 155var fieldAction = CreateCodeAction( 158var propertyAction = CreateCodeAction( 168var allFieldsAction = CodeAction.Create( 171var allPropertiesAction = CodeAction.Create(
MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeRefactoringProvider.cs (1)
44context.RegisterRefactoring(CodeAction.Create(
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
79CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAtStartCodeFixProvider.cs (1)
48CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (2)
42var documentChangeAction = CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (1)
44CodeAction.Create(title, GetDocumentUpdater(context), equivalenceKey),
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (3)
33public static async Task<CodeAction?> GetCodeActionAsync( 66var positional = CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\CSharpConvertToRecordCodeFixProvider.cs (1)
43var action = await ConvertToRecordEngine.GetCodeActionAsync(
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (1)
40protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.cs (1)
31protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (1)
57protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (1)
80protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
47protected override async Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (1)
51context.RegisterCodeFix(CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (2)
45protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken) 82return CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
36protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken) 107return CodeAction.Create(title, _ => Task.FromResult(newDocument), title);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
41CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
55CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
77CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
35CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
35CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
36CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
35CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
38CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (2)
40CodeAction.Create( 47CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (1)
47CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (1)
49CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
34CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
55CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
53CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
45CodeAction.Create(title, GetDocumentUpdater(context), title),
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
70CodeAction.Create( 84CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorFixAllProvider.cs (1)
32public override Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
51CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockFixAllProvider.cs (1)
24public override Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (2)
122CodeAction.Create( 135CodeAction.Create(
UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeRefactoringProvider.cs (6)
90private static async Task<ImmutableArray<CodeAction>> ComputeOpposingRefactoringsWhenAnalyzerActiveAsync( 146private static async Task<ImmutableArray<CodeAction>> ComputeAllRefactoringsWhenAnalyzerInactiveAsync( 162private static async Task<ImmutableArray<CodeAction>> ComputeRefactoringsAsync( 171using var result = TemporaryArray<CodeAction>.Empty; 176result.Add(CodeAction.Create( 185result.Add(CodeAction.Create(
UsePatternMatching\CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs (1)
33CodeAction.Create(
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (35)
ConvertAnonymousType\ConvertAnonymousTypeToTupleTests.cs (2)
23protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
ConvertNumericLiteral\ConvertNumericLiteralTests.cs (2)
23protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
ConvertToRecord\ConvertToRecordCodeRefactoringTests.cs (2)
41CodeAction? codeAction = null; 84void Verify(CodeAction action, IVerifier _)
Diagnostics\Configuration\ConfigureCodeStyle\MultipleCodeStyleOptionConfigurationTests.cs (3)
26protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions) 29var nestedActionForOptionIndex = ((AbstractConfigurationActionWithNestedActions)actions[0]).NestedActions[OptionIndex];
Diagnostics\Suppression\SuppressionTests.cs (4)
798protected override async Task<(ImmutableArray<CodeAction>, CodeAction actionToInvoke)> GetCodeActionsAsync(TestWorkspace workspace, TestParameters parameters) 1044protected override async Task<(ImmutableArray<CodeAction>, CodeAction actionToInvoke)> GetCodeActionsAsync(TestWorkspace workspace, TestParameters parameters)
FullyQualify\FullyQualifyTests.cs (2)
31protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
FullyQualify\FullyQualifyUnboundIdentifierTests.cs (2)
31protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
GenerateVariable\GenerateVariableTests.cs (2)
48protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
IntroduceParameter\IntroduceParameterTests.cs (2)
25protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
IntroduceVariable\InteractiveIntroduceVariableTests.cs (2)
23protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
IntroduceVariable\IntroduceVariableTests.cs (2)
28protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
SpellCheck\SpellCheckTests.cs (2)
32protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
src\Analyzers\CSharp\Tests\AddExplicitCast\AddExplicitCastTests.cs (2)
25protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
src\Analyzers\CSharp\Tests\AddParameter\AddParameterTests.cs (2)
28protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
src\Analyzers\CSharp\Tests\AliasAmbiguousType\AliasAmbiguousTypeTests.cs (2)
27protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
Wrapping\AbstractWrappingTests.cs (2)
23protected sealed override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
Microsoft.CodeAnalysis.EditorFeatures (25)
RenameTracking\RenameTrackingCodeRefactoringProvider.cs (1)
32this.CustomTags = this.CustomTags.Add(CodeAction.CanBeHighPriorityTag);
RenameTracking\RenameTrackingTaggerProvider.cs (1)
99public static (CodeAction action, TextSpan renameSpan) TryGetCodeAction(
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCodeAction.cs (1)
50this.CustomTags = this.CustomTags.Add(CodeAction.CanBeHighPriorityTag);
RenameTracking\RenameTrackingTaggerProvider.StateMachine.cs (1)
283internal (CodeAction action, TextSpan renameSpan) TryGetCodeAction(
Suggestions\Copilot\FlavoredSuggestedAction.cs (5)
17/// Each <see cref="CodeAction"/> can define custom <see cref="CodeAction.AdditionalPreviewFlavors"/> 21/// <see cref="CodeAction.AdditionalPreviewFlavors"/> and gets added to the suggested action set 33CodeAction originalCodeAction) 38public static SuggestedAction Create(SuggestedActionWithNestedFlavors suggestedAction, CodeAction codeAction)
Suggestions\PreviewChanges\PreviewChangesCodeAction.cs (2)
21private readonly CodeAction _originalCodeAction; 24public PreviewChangesCodeAction(Workspace workspace, CodeAction originalCodeAction, Func<CancellationToken, Task<SolutionPreviewResult?>> getPreviewResultAsync)
Suggestions\RefineUsingCopilot\RefineUsingCopilotCodeAction.cs (1)
30CodeAction originalCodeAction,
Suggestions\SuggestedActions\AbstractFixAllSuggestedAction.cs (2)
21public CodeAction OriginalCodeAction { get; } 32CodeAction originalCodeAction,
Suggestions\SuggestedActions\CodeFixSuggestedAction.cs (1)
33CodeAction action,
Suggestions\SuggestedActions\CodeRefactoringSuggestedAction.cs (1)
30CodeAction codeAction,
Suggestions\SuggestedActions\FixAllCodeFixSuggestedAction.cs (1)
31CodeAction originalCodeAction)
Suggestions\SuggestedActions\FixAllCodeRefactoringSuggestedAction.cs (1)
27CodeAction originalCodeAction)
Suggestions\SuggestedActions\SuggestedAction.cs (3)
46internal readonly CodeAction CodeAction; 57CodeAction codeAction) 310var otherCodeAction = otherSuggestedAction.CodeAction;
Suggestions\SuggestedActionWithNestedActions.cs (2)
34CodeAction codeAction, 49CodeAction codeAction,
Suggestions\SuggestedActionWithNestedFlavors.cs (2)
46CodeAction codeAction, 125foreach (var action in this.CodeAction.AdditionalPreviewFlavors)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (17)
CodeFixes\CodeFixServiceTests.cs (7)
116foreach (var codeAction in codeActions) 403CodeAction.Create( 786context.RegisterCodeFix(CodeAction.Create(_name, ct => Task.FromResult(context.Document)), fixableDiagnostics); 830CodeAction.Create( 860var codeAction = txtDocumentCodeFixes.Single(s => s.Fixes.Single().Action.Title == fixer1.Title).Fixes.Single().Action; 913context.RegisterCodeFix(CodeAction.Create(Title, 1210CodeAction.Create(Title,
CodeFixes\ErrorCases\CodeFixExceptionInGetFixAllProvider.cs (1)
28context.RegisterCodeFix(CodeAction.Create("Do Nothing", token => Task.FromResult(context.Document)), context.Diagnostics[0]);
CodeRefactorings\CodeRefactoringServiceTest.cs (5)
68context.RegisterRefactoring(CodeAction.Create($"Blocking=false", _ => Task.FromResult<Document>(null))); 122context.RegisterRefactoring(CodeAction.Create( 181var codeAction = txtRefactorings.Single(s => s.CodeActions.Single().action.Title == refactoring1.Title).CodeActions.Single().action; 220var codeAction = editorConfigRefactorings.Single(s => s.CodeActions.Single().action.Title == refactoring1.Title).CodeActions.Single().action; 300context.RegisterRefactoring(CodeAction.Create(Title,
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (1)
111context.RegisterRefactoring(CodeAction.Create("Description", _ => Task.FromResult(newSolution)), context.Span);
RenameTracking\RenameTrackingTestState.cs (3)
165public async Task<CodeAction> TryGetCodeActionAsync(TextSpan? textSpan = null) 171var actions = new List<CodeAction>(); 190var codeAction = await TryGetCodeActionAsync(tag.Span.Span.ToTextSpan());
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (16)
CodeFixes\CodeFixServiceTests.vb (2)
229context.RegisterCodeFix(CodeAction.Create("FIX_TEST0000", Function(ct) Task.FromResult(context.Document.WithSyntaxRoot(root))), context.Diagnostics) 254context.RegisterCodeFix(CodeAction.Create("FIX_TEST1111", Function(ct) Task.FromResult(context.Document.WithSyntaxRoot(root))), context.Diagnostics)
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (5)
45Protected Overridable Function MassageActions(actions As IList(Of CodeAction)) As IList(Of CodeAction) 49Protected Shared Function FlattenActions(codeActions As IEnumerable(Of CodeAction)) As IList(Of CodeAction) 74Dim codeActions As IList(Of CodeAction) = diagnosticAndFix.Item2.Fixes.Select(Function(f) f.Action).ToList()
Diagnostics\AddImport\AddImportCrossLanguageTests.vb (5)
267glyphTags:=WellKnownTagArrays.CSharpProject.Add(CodeAction.RequiresNonDocumentChange), 355glyphTags:=WellKnownTagArrays.CSharpProject.Add(CodeAction.RequiresNonDocumentChange), 402glyphTags:=WellKnownTagArrays.CSharpProject.Add(CodeAction.RequiresNonDocumentChange), 448glyphTags:=WellKnownTagArrays.VisualBasicProject.Add(CodeAction.RequiresNonDocumentChange), 527glyphTags:=WellKnownTagArrays.CSharpProject.Add(CodeAction.RequiresNonDocumentChange),
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
121context.RegisterCodeFix(CodeAction.Create("Request serialization permission", Function(ct) Task.FromResult(newSln)), context.Diagnostics)
Diagnostics\GenerateFromUsage\GenerateVariableCrossLanguageTests.vb (2)
28Protected Overrides Function MassageActions(actions As IList(Of CodeAction)) As IList(Of CodeAction)
Rename\InlineRenameTests.vb (1)
1277Dim actions = New List(Of CodeAction)
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (2)
AddPackage\AspNetCoreAddPackageCodeAction.cs (2)
38public static async Task<CodeAction?> TryCreateCodeActionAsync( 67var cleanedDocument = await CodeAction.CleanupDocumentAsync(
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
CodeActions\OmniSharpCodeFixContextFactory.cs (2)
21Action<CodeAction, ImmutableArray<Diagnostic>> registerCodeFix, 28Action<CodeAction, TextSpan?> registerRefactoring,
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (1)
Cohost\Handlers\CodeActions.cs (1)
59var codeActionToResolve = CodeActionHelpers.GetCodeActionToResolve(data.CodeActionPath, codeActions, isFixAllAction: false);
Microsoft.CodeAnalysis.Features (396)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.cs (6)
78private static ImmutableArray<CodeAction> GetGroupedActions(AddConstructorParameterResult result) 80using var _ = ArrayBuilder<CodeAction>.GetInstance(out var actions); 85actions.Add(CodeAction.Create( 87result.RequiredParameterActions.Cast<AddConstructorParametersCodeAction, CodeAction>(), 91actions.Add(CodeAction.Create( 93result.OptionalParameterActions.Cast<AddConstructorParametersCodeAction, CodeAction>(),
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
59context.RegisterRefactoring(CodeAction.Create(
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (1)
80CodeAction.Create(
AddImport\AbstractAddImportCodeFixProvider.cs (1)
32this.CustomTags = this.CustomTags.Add(CodeAction.CanBeHighPriorityTag);
AddImport\AbstractAddImportFeatureService.cs (3)
603public ImmutableArray<CodeAction> GetCodeActionsForFixes( 607using var _ = ArrayBuilder<CodeAction>.GetInstance(out var result); 619private static CodeAction? TryCreateCodeAction(Document document, AddImportFixData fixData, IPackageInstallerService? installerService)
AddImport\CodeActions\AddImportCodeAction.cs (1)
53this.CustomTags = this.CustomTags.Add(CodeAction.CanBeHighPriorityTag);
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (1)
53var solutionChangeAction = SolutionChangeAction.Create("", GetUpdatedSolutionAsync, "");
AddImport\IAddImportFeatureService.cs (1)
40ImmutableArray<CodeAction> GetCodeActionsForFixes(
AddImport\References\Reference.cs (1)
119var cleanedDocument = await CodeAction.CleanupDocumentAsync(
AddImport\References\SymbolReference.cs (1)
66var cleanedDocument = await CodeAction.CleanupDocumentAsync(
AddMissingReference\AbstractAddMissingReferenceCodeFixProvider.cs (3)
44private static async Task<ImmutableArray<CodeAction>> GetAddReferencesCodeActionsAsync(CodeFixContext context, ISet<AssemblyIdentity> uniqueIdentities) 46var result = ArrayBuilder<CodeAction>.GetInstance(); 49var codeAction = await AddMissingReferenceCodeAction.CreateAsync(
AddMissingReference\AddMissingReferenceCodeAction.cs (1)
29public static async Task<CodeAction> CreateAsync(Project project, AssemblyIdentity missingAssemblyIdentity, CancellationToken cancellationToken)
AddPackage\AbstractAddPackageCodeFixProvider.cs (2)
29protected async Task<ImmutableArray<CodeAction>> GetAddPackagesCodeActionsAsync( 50var codeActions = ArrayBuilder<CodeAction>.GetInstance();
AddPackage\InstallPackageParentCodeAction.cs (3)
30Document document) : CodeAction.CodeActionWithNestedActions(string.Format(FeaturesResources.Install_package_0, packageName), 40private static ImmutableArray<CodeAction> CreateNestedActions( 64private static CodeAction CreateCodeAction(
AddPackage\ParentInstallPackageCodeAction.cs (5)
41internal sealed class ParentInstallPackageCodeAction : CodeAction.CodeActionWithNestedActions 66public static CodeAction? TryCreateCodeAction( 78private static ImmutableArray<CodeAction> CreateNestedActions( 87using var _ = ArrayBuilder<CodeAction>.GetInstance(out var codeActions); 107private static CodeAction CreateCodeAction(
CodeFixes\AbstractConfigurationActionWithNestedActions.cs (2)
15internal abstract class AbstractConfigurationActionWithNestedActions : CodeAction.CodeActionWithNestedActions 17protected AbstractConfigurationActionWithNestedActions(ImmutableArray<CodeAction> nestedActions, string title)
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.cs (4)
20using static Microsoft.CodeAnalysis.CodeActions.CodeAction; 76using var _ = ArrayBuilder<CodeAction>.GetInstance(out var nestedActions); 90var resultCodeAction = nestedActions.Count > 1 106using var _ = ArrayBuilder<CodeAction>.GetInstance(out var nestedActions);
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.TopLevelConfigureCodeStyleOptionCodeAction.cs (2)
14public TopLevelConfigureCodeStyleOptionCodeAction(Diagnostic diagnostic, ImmutableArray<CodeAction> nestedActions) 19public TopLevelConfigureCodeStyleOptionCodeAction(string optionName, ImmutableArray<CodeAction> nestedActions)
CodeFixes\Configuration\ConfigureSeverity\ConfigureSeverityLevelCodeFixProvider.cs (3)
16using static Microsoft.CodeAnalysis.CodeActions.CodeAction; 60var nestedActions = ArrayBuilder<CodeAction>.GetInstance(); 101var nestedActions = ArrayBuilder<CodeAction>.GetInstance();
CodeFixes\Configuration\ConfigureSeverity\ConfigureSeverityLevelCodeFixProvider.TopLevelBulkConfigureSeverityCodeAction.cs (1)
12private sealed class TopLevelBulkConfigureSeverityCodeAction(ImmutableArray<CodeAction> nestedActions, string? category) : AbstractConfigurationActionWithNestedActions(nestedActions,
CodeFixes\Configuration\ConfigureSeverity\ConfigureSeverityLevelCodeFixProvider.TopLevelConfigureSeverityCodeAction.cs (1)
12private sealed class TopLevelConfigureSeverityCodeAction(Diagnostic diagnostic, ImmutableArray<CodeAction> nestedActions) : AbstractConfigurationActionWithNestedActions(nestedActions, string.Format(FeaturesResources.Configure_0_severity, diagnostic.Id))
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (27)
30public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext) 44private async Task<CodeAction?> GetFixAsync( 74private async Task<ImmutableArray<(Diagnostic diagnostic, CodeAction action)>> GetDiagnosticsAndCodeActionsAsync( 95return await ProducerConsumer<(Diagnostic diagnostic, CodeAction action)>.RunParallelAsync( 113Action<(Diagnostic diagnostic, CodeAction action)> onItemFound, 134private async Task<CodeAction?> GetFixAsync( 146var bag = new ConcurrentBag<(Diagnostic diagnostic, CodeAction action)>(); 175private static Action<CodeAction, ImmutableArray<Diagnostic>> GetRegisterCodeFixAction( 177Action<(Diagnostic diagnostic, CodeAction action)> onItemFound) 181using var _ = ArrayBuilder<CodeAction>.GetInstance(out var stack); 183while (stack.TryPop(out var currentAction)) 191foreach (var nestedAction in currentAction.NestedActions) 201ConcurrentBag<(Diagnostic diagnostic, CodeAction action)> fixes, 207public virtual async Task<CodeAction?> TryGetMergedFixAsync( 208ImmutableArray<(Diagnostic diagnostic, CodeAction action)> batchOfFixes, 219return CodeAction.SolutionChangeAction.Create(title, _ => Task.FromResult(newSolution), title); 227ImmutableArray<(Diagnostic diagnostic, CodeAction action)> diagnosticsAndCodeActions, 248private static async Task<IReadOnlyDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>>> GetDocumentIdToChangedDocumentsAsync( 250ImmutableArray<(Diagnostic diagnostic, CodeAction action)> diagnosticsAndCodeActions, 254var documentIdToChangedDocuments = new ConcurrentDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>>(); 272IReadOnlyDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>> documentIdToChangedDocuments, 273ImmutableArray<(Diagnostic diagnostic, CodeAction action)> diagnosticsAndCodeActions, 297Dictionary<CodeAction, int> codeActionToDiagnosticLocation, 299IEnumerable<(CodeAction action, Document document)> changedDocuments, 340private static readonly Func<DocumentId, ConcurrentBag<(CodeAction, Document)>> s_getValue = 345ConcurrentDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>> documentIdToChangedDocuments, 346CodeAction codeAction,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.FixAllProvider.cs (1)
26public override async Task<CodeAction> GetFixAsync(FixAllContext fixAllContext)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (2)
41internal static CodeAction Create(string title, AbstractSuppressionCodeFixProvider fixer, Document triggerDocument, ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsByDocument) 48internal static CodeAction Create(string title, AbstractSuppressionCodeFixProvider fixer, Project triggerProject, ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsByProject)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (3)
26public static CodeAction CreateBatchPragmaFix( 34return CodeAction.Create( 35((CodeAction)pragmaActions[0]).Title,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningBatchFixAllProvider.cs (2)
28Action<(Diagnostic diagnostic, CodeAction action)> onItemFound, 55var pragmaBatchFix = PragmaBatchFixHelpers.CreateBatchPragmaFix(
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (8)
36Action<(Diagnostic diagnostic, CodeAction action)> onItemFound, 74var pragmaBatchFix = PragmaBatchFixHelpers.CreateBatchPragmaFix( 86ConcurrentBag<(Diagnostic diagnostic, CodeAction action)> bag, 105public override async Task<CodeAction> TryGetMergedFixAsync( 106ImmutableArray<(Diagnostic diagnostic, CodeAction action)> batchOfFixes, 119var newBatchOfFixes = new List<(Diagnostic diagnostic, CodeAction action)>(); 147var batchAttributeRemoveFix = CodeAction.Create(
CodeFixes\Suppression\TopLevelSuppressionCodeAction.cs (1)
10internal sealed class TopLevelSuppressionCodeAction(Diagnostic diagnostic, ImmutableArray<NestedSuppressionCodeAction> nestedActions) : AbstractConfigurationActionWithNestedActions(ImmutableArray<CodeAction>.CastUp(nestedActions), string.Format(FeaturesResources.Suppress_0, diagnostic.Id))
CodeFixesAndRefactorings\AbstractFixAllGetFixesService.cs (5)
27var codeAction = await GetFixAllCodeActionAsync(fixAllContext).ConfigureAwait(false); 40var codeAction = await GetFixAllCodeActionAsync(fixAllContext).ConfigureAwait(false); 51CodeAction codeAction, 156private static async Task<CodeAction?> GetFixAllCodeActionAsync(IFixAllContext fixAllContext) 175CodeAction? action = null;
CodeRefactorings\AddAwait\AbstractAddAwaitCodeRefactoringProvider.cs (2)
53CodeAction.Create( 61CodeAction.Create(
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (1)
183CodeAction codeAction,
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsRefactoringProvider.cs (2)
45var addImportsCodeAction = CodeAction.Create(
CodeRefactorings\CodeRefactoring.cs (2)
27public ImmutableArray<(CodeAction action, TextSpan? applicableToSpan)> CodeActions { get; } 33ImmutableArray<(CodeAction, TextSpan?)> actions,
CodeRefactorings\CodeRefactoringService.cs (1)
252using var _ = ArrayBuilder<(CodeAction action, TextSpan? applicableToSpan)>.GetInstance(out var actions);
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (9)
53private static async Task<ImmutableArray<CodeAction>> GetCodeActionsAsync( 59using var _ = ArrayBuilder<CodeAction>.GetInstance(out var actions); 60var methodAction = await ExtractMethodAsync(document, textSpan, extractOptions, cancellationToken).ConfigureAwait(false); 63var localFunctionAction = await ExtractLocalFunctionAsync(document, textSpan, extractOptions, cancellationToken).ConfigureAwait(false); 69private static async Task<CodeAction> ExtractMethodAsync( 84return CodeAction.Create( 94private static async Task<CodeAction> ExtractLocalFunctionAsync( 115var codeAction = CodeAction.Create(
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (4)
30public abstract Task<ImmutableArray<CodeAction>> GetRefactoringAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken); 48public override async Task<ImmutableArray<CodeAction>> GetRefactoringAsync( 80private ImmutableArray<CodeAction> CreateActions( 93using var _ = ArrayBuilder<CodeAction>.GetInstance(out var actions);
CodeRefactorings\MoveType\IMoveTypeService.cs (1)
16Task<ImmutableArray<CodeAction>> GetRefactoringAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.cs (2)
84var solutionChangeAction = CodeAction.Create(
Common\DocumentNavigationOperation.cs (2)
13/// When <see cref="CodeAction.GetOperationsAsync(CancellationToken)"/> is called an implementation 14/// of <see cref="CodeAction"/> can return an instance of this operation along with the other
Common\StartInlineRenameSessionOperation.cs (2)
13/// When <see cref="CodeAction.GetOperationsAsync(System.Threading.CancellationToken)"/> is called an implementation 14/// of <see cref="CodeAction"/> can return an instance of this operation along with the other
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (2)
64CodeAction.Create( 72CodeAction.Create(
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (4)
57CodeAction.Create( 60CodeAction.Create(FeaturesResources.just_this_anonymous_type, c => FixInCurrentMemberAsync(document, anonymousNode, anonymousType, allAnonymousTypes: false, c), nameof(FeaturesResources.just_this_anonymous_type)), 61CodeAction.Create(FeaturesResources.all_anonymous_types_in_container, c => FixInCurrentMemberAsync(document, anonymousNode, anonymousType, allAnonymousTypes: true, c), nameof(FeaturesResources.all_anonymous_types_in_container)), 70CodeAction.Create(FeaturesResources.Convert_to_tuple, c => FixInCurrentMemberAsync(document, anonymousNode, anonymousType, allAnonymousTypes: false, c), nameof(FeaturesResources.Convert_to_tuple)),
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (2)
50context.RegisterRefactoring(CodeAction.Create( 61context.RegisterRefactoring(CodeAction.Create(
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
60CodeAction.Create(
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
78CodeAction.Create(
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
135CodeAction.Create(
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (2)
53CodeAction.Create( 63CodeAction.Create(
ConvertLinq\AbstractConvertLinqQueryToForEachProvider.cs (1)
47CodeAction.Create(
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (2)
114CodeAction.Create( 137CodeAction.Create(
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (4)
72using var result = TemporaryArray<CodeAction>.Empty; 105context.RegisterRefactoring(CodeAction.Create( 111CodeAction CreateCodeAction(string text, string title) 112=> CodeAction.Create(title, c => ReplaceTokenAsync(document, root, numericToken, value, text, suffix), title);
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
110CodeAction.Create(
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
134CodeAction.Create(
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (1)
75CodeAction.Create(
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (6)
97CodeAction.Create( 109CodeAction.Create( 118ImmutableArray<CodeAction> CreateChildActions( 126using var scopes = TemporaryArray<CodeAction>.Empty; 170private CodeAction CreateAction(Document document, TextSpan span, Scope scope, bool isRecord) 171=> CodeAction.Create(GetTitle(scope), c => ConvertToStructAsync(document, span, scope, isRecord, c), scope.ToString());
Copilot\ICopilotChangeAnalysisService.cs (3)
153private static CodeAction GetFirstAction(CodeFix codeFix) 155var action = codeFix.Action; 269var firstAction = GetFirstAction(codeFixCollection.Fixes[0]);
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDetectionCodeFixProvider.cs (1)
38CodeAction.Create(
EncapsulateField\AbstractEncapsulateFieldService.cs (8)
58public async Task<ImmutableArray<CodeAction>> GetEncapsulateFieldCodeActionsAsync(Document document, TextSpan span, CancellationToken cancellationToken) 69using var builder = TemporaryArray<CodeAction>.Empty; 82private ImmutableArray<CodeAction> EncapsulateAllFields(Document document, ImmutableArray<IFieldSymbol> fields) 84CodeAction.Create( 88CodeAction.Create( 94private ImmutableArray<CodeAction> EncapsulateOneField(Document document, IFieldSymbol field) 99CodeAction.Create( 103CodeAction.Create(
EncapsulateField\IEncapsulateFieldService.cs (1)
16Task<ImmutableArray<CodeAction>> GetEncapsulateFieldCodeActionsAsync(Document document, TextSpan span, CancellationToken cancellationToken);
Formatting\AbstractNewDocumentFormattingService.cs (1)
55document = await CodeAction.CleanupDocumentAsync(document, options, cancellationToken).ConfigureAwait(false);
FullyQualify\AbstractFullyQualifyCodeFixProvider.cs (2)
36d => CodeAction.Create( 49context.RegisterCodeFix(CodeAction.Create(
FullyQualify\AbstractFullyQualifyService.cs (1)
222var cleanedDocument = await CodeAction.CleanupDocumentAsync(
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (4)
95context.RegisterRefactoring(CodeAction.Create( 102using var _2 = ArrayBuilder<CodeAction>.GetInstance(out var nestedActions); 108nestedActions.Add(CodeAction.Create( 114context.RegisterRefactoring(CodeAction.Create(
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (10)
82using var _1 = ArrayBuilder<CodeAction>.GetInstance(out var actions); 99foreach (var action in actions) 110Document priorDocument, CodeAction codeAction, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 129CodeAction action, 154Action<CodeAction, TextSpan> registerSingleAction, 155Action<ImmutableArray<CodeAction>> registerMultipleActions, 190private async Task<(CodeAction CodeAction, TextSpan ApplicableToSpan)?> HandleNonSelectionAsync( 265public async Task<ImmutableArray<CodeAction>> GenerateConstructorFromMembersAsync( 282private ImmutableArray<CodeAction> GetCodeActions(Document document, State state, bool addNullChecks) 284using var result = TemporaryArray<CodeAction>.Empty;
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.GenerateConstructorWithDialogCodeAction.cs (2)
99var codeAction = state.DelegatedConstructor != null 101: (CodeAction)new FieldDelegatingCodeAction(_service, _document, state, addNullChecks);
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (6)
169public async Task<ImmutableArray<CodeAction>> GenerateEqualsAndGetHashCodeFromMembersAsync( 200private async Task<ImmutableArray<CodeAction>> CreateActionsAsync( 204using var _ = ArrayBuilder<Task<CodeAction>>.GetInstance(out var tasks); 240private Task<CodeAction> CreateCodeActionAsync( 257private async Task<CodeAction> CreateCodeActionWithDialogAsync( 294private static async Task<CodeAction> CreateCodeActionWithoutDialogAsync(
GenerateType\AbstractGenerateTypeService.cs (4)
65public async Task<ImmutableArray<CodeAction>> GenerateTypeAsync( 82return [CodeAction.Create( 97private ImmutableArray<CodeAction> GetActions( 103using var _ = ArrayBuilder<CodeAction>.GetInstance(out var result);
GenerateType\IGenerateTypeService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateTypeAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (13)
68protected override async Task<ImmutableArray<CodeAction>> GetRefactoringsForAllParametersAsync( 93return [CodeAction.Create( 99protected override async Task<ImmutableArray<CodeAction>> GetRefactoringsForSingleParameterAsync( 116using var result = TemporaryArray<CodeAction>.Empty; 117result.Add(CodeAction.Create( 126result.Add(CodeAction.Create( 131result.Add(CodeAction.Create( 146var negativeCheckAction = CodeAction.Create( 151var negativeOrZeroCheckAction = CodeAction.Create( 162var action = CodeAction.Create(
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (19)
49protected sealed override Task<ImmutableArray<CodeAction>> GetRefactoringsForAllParametersAsync( 54return SpecializedTasks.EmptyImmutableArray<CodeAction>(); 57protected sealed override async Task<ImmutableArray<CodeAction>> GetRefactoringsForSingleParameterAsync( 102private async Task<ImmutableArray<CodeAction>> HandleNoExistingFieldOrPropertyAsync( 113using var _ = ArrayBuilder<CodeAction>.GetInstance(out var allActions); 154private (CodeAction? fieldAction, CodeAction? propertyAction) AddAllParameterInitializationActions( 173var allFieldsAction = CodeAction.Create( 178var allPropertiesAction = CodeAction.Create( 187private (CodeAction fieldAction, CodeAction propertyAction) AddSpecificParameterInitializationActions( 201var fieldAction = CodeAction.Create( 205var propertyAction = CodeAction.Create( 236private ImmutableArray<CodeAction> HandleExistingFieldOrProperty( 253return [CodeAction.Create(
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (2)
37protected abstract Task<ImmutableArray<CodeAction>> GetRefactoringsForAllParametersAsync( 46protected abstract Task<ImmutableArray<CodeAction>> GetRefactoringsForSingleParameterAsync(
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (7)
237var nestedCodeAction = CodeAction.Create( 245private ImmutableArray<CodeAction> GenerateCodeActions(Document document, 255var codeActionRemovesCallee = CodeAction.Create( 270var codeActionKeepsCallee = CodeAction.Create(
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (8)
105CodeAction.Create( 114CodeAction.Create( 145private async Task<(ImmutableArray<CodeAction> actions, ImmutableArray<CodeAction> actionsAllOccurrences)?> GetActionsAsync(Document document, 154using var actionsBuilder = TemporaryArray<CodeAction>.Empty; 155using var actionsBuilderAllOccurrences = TemporaryArray<CodeAction>.Empty; 188CodeAction CreateNewCodeAction(string actionName, bool allOccurrences, IntroduceParameterCodeActionKind selectedCodeAction) 190return CodeAction.Create(
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (2)
79CodeAction.Create( 93CodeAction.Create(
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (2)
55CodeAction.Create( 63CodeAction.Create(
IntroduceVariable\AbstractIntroduceVariableService.cs (6)
62public async Task<CodeAction> IntroduceVariableAsync( 82return CodeAction.Create(title, actions, isInlinable: true); 89private (string title, ImmutableArray<CodeAction>) CreateActions(State state, CancellationToken cancellationToken) 94using var _ = ArrayBuilder<CodeAction>.GetInstance(out var actions); 100private string AddActionsAndGetTitle(State state, ArrayBuilder<CodeAction> actions, CancellationToken cancellationToken) 190private void CreateConstantFieldActions(State state, ArrayBuilder<CodeAction> actions, CancellationToken cancellationToken)
IntroduceVariable\IIntroduceVariableService.cs (1)
16Task<CodeAction> IntroduceVariableAsync(Document document, TextSpan textSpan, CodeCleanupOptions options, CancellationToken cancellationToken);
IntroduceVariable\IntroduceVariableCodeRefactoringProvider.cs (1)
31var action = await service.IntroduceVariableAsync(document, textSpan, cleanupOptions, cancellationToken).ConfigureAwait(false);
InvertConditional\AbstractInvertConditionalCodeRefactoringProvider.cs (1)
32CodeAction.Create(
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (1)
96CodeAction.Create(
InvertLogical\AbstractInvertLogicalCodeRefactoringProvider.cs (1)
75CodeAction.Create(
MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceCodeRefactoringProvider.cs (1)
38CodeAction.Create(
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
33CodeAction.Create(
OrganizeImports\OrganizeImportsCodeRefactoringProvider.cs (1)
89context.RegisterRefactoring(CodeAction.Create(
PreferFrameworkType\PreferFrameworkTypeCodeFixProvider.cs (1)
36CodeAction.Create(
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (1)
61context.RegisterRefactoring(CodeAction.Create(
PullMemberUp\MembersPuller.cs (2)
25using static Microsoft.CodeAnalysis.CodeActions.CodeAction; 38public static CodeAction TryComputeCodeAction(
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
52CodeAction.Create(
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (2)
134context.RegisterRefactoring(CodeAction.Create( 162context.RegisterRefactoring(CodeAction.Create(
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
150CodeAction.Create(
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
69context.RegisterRefactoring(CodeAction.Create( 82context.RegisterRefactoring(CodeAction.Create(
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (1)
64CodeAction.Create(
SimplifyThisOrMe\AbstractSimplifyThisOrMeCodeFixProvider.cs (1)
33CodeAction.Create(
SimplifyTypeNames\AbstractSimplifyTypeNamesCodeFixProvider.cs (1)
94CodeAction.Create(
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (4)
178.ToImmutableArrayOrEmpty<CodeAction>(); 185CodeAction.Create( 211private CodeAction CreateCodeAction(SyntaxToken nameToken, string oldName, string newName, Document document) 213return CodeAction.Create(
SplitOrMergeIfStatements\AbstractMergeIfStatementsCodeRefactoringProvider.cs (1)
24protected abstract CodeAction CreateCodeAction(
SplitOrMergeIfStatements\AbstractSplitIfStatementCodeRefactoringProvider.cs (1)
23protected abstract CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, string ifKeywordText);
SplitOrMergeIfStatements\Consecutive\AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
48protected sealed override CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, MergeDirection direction, string ifKeywordText) 52return CodeAction.Create(title, createChangedDocument, title);
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
47protected sealed override CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, string ifKeywordText) 48=> CodeAction.Create(
SplitOrMergeIfStatements\Nested\AbstractMergeNestedIfStatementsCodeRefactoringProvider.cs (2)
36protected sealed override CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, MergeDirection direction, string ifKeywordText) 40return CodeAction.Create(title, createChangedDocument, title);
SplitOrMergeIfStatements\Nested\AbstractSplitIntoNestedIfStatementsCodeRefactoringProvider.cs (2)
34protected sealed override CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, string ifKeywordText) 35=> CodeAction.Create(
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (1)
45CodeAction.Create(
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (3)
90using var actions = TemporaryArray<CodeAction>.Empty; 97actions.Add(CodeAction.Create( 112CodeAction.Create(AnalyzersResources.Add_explicit_cast, actions.ToImmutableAndClear(), isInlinable: false),
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (12)
256ImmutableArray<CodeAction> NestByOverload() 258var builder = new FixedSizeArrayBuilder<CodeAction>(codeFixData.Length); 263var codeAction = CodeAction.Create( 274codeAction = CodeAction.Create( 278CodeAction.Create( 293ImmutableArray<CodeAction> NestByCascading() 295using var builder = TemporaryArray<CodeAction>.Empty; 300return CodeAction.Create(title, data.CreateChangedSolutionNonCascading, equivalenceKey: title); 308return CodeAction.Create(title, data.CreateChangedSolutionCascading!, equivalenceKey: title); 316builder.Add(CodeAction.Create(nestedNonCascadingTitle, nonCascadingActions, isInlinable: false)); 323builder.Add(CodeAction.Create(nestedCascadingTitle, cascadingActions, isInlinable: false));
src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (1)
34CodeAction.Create(
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (3)
52using var _ = ArrayBuilder<CodeAction>.GetInstance(out var actions); 58actions.Add(CodeAction.Create( 70CodeAction.Create(
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (5)
52this.CustomTags = this.CustomTags.Add(CodeAction.CanBeHighPriorityTag); 301static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey) 303var codeAction = CodeAction.Create(title, action, equivalenceKey, CodeActionPriority.High); 307codeAction.CustomTags = codeAction.CustomTags.Add(CodeAction.CanBeHighPriorityTag);
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (3)
29var codeAction = await GetCodeActionAsync( 51private async Task<CodeAction?> GetCodeActionAsync( 62return CodeAction.Create(
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
41CodeAction.Create(
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
40CodeAction.Create(
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
35CodeAction.Create(
src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (4)
24this.CustomTags = this.CustomTags.Add(CodeAction.CanBeHighPriorityTag); 53var codeAction = CodeAction.Create( 61codeAction.CustomTags = codeAction.CustomTags.Add(CodeAction.CanBeHighPriorityTag);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (5)
80public async Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 91using var result = TemporaryArray<CodeAction>.Empty; 96result.Add(CodeAction.Create( 105result.Add(CodeAction.Create( 112result.Add(CodeAction.Create(
src\Analyzers\Core\CodeFixes\GenerateConstructor\IGenerateConstructorService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.cs (2)
25public async Task<ImmutableArray<CodeAction>> GenerateDefaultConstructorsAsync( 35using var _ = ArrayBuilder<CodeAction>.GetInstance(out var result);
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\IGenerateDefaultConstructorsService.cs (1)
16Task<ImmutableArray<CodeAction>> GenerateDefaultConstructorsAsync(
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.cs (1)
25public async Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateEnumMember\IGenerateEnumMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (1)
25protected abstract Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (1)
27public async Task<ImmutableArray<CodeAction>> GenerateConversionAsync(
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.cs (1)
23public async Task<ImmutableArray<CodeAction>> GenerateDeconstructMethodAsync(
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.cs (1)
28public async Task<ImmutableArray<CodeAction>> GenerateMethodAsync(
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (2)
36protected async ValueTask<ImmutableArray<CodeAction>> GetActionsAsync(Document document, State state, CancellationToken cancellationToken) 38using var _ = ArrayBuilder<CodeAction>.GetInstance(out var result);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateConversionService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateConversionAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateDeconstructMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateDeconstructMethodAsync(
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateParameterizedMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateMethodAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (9)
32public async Task<ImmutableArray<CodeAction>> GenerateVariableAsync( 45using var _ = ArrayBuilder<CodeAction>.GetInstance(out var actions); 73return [CodeAction.Create( 87ArrayBuilder<CodeAction> result, SemanticDocument document, State state, CancellationToken cancellationToken) 130private static void GenerateWritableProperty(ArrayBuilder<CodeAction> result, SemanticDocument document, State state) 137private static void AddFieldCodeActions(ArrayBuilder<CodeAction> result, SemanticDocument document, State state) 169private static void GenerateWriteableField(ArrayBuilder<CodeAction> result, SemanticDocument document, State state) 176ArrayBuilder<CodeAction> result, Document document, State state, CancellationToken cancellationToken) 192ArrayBuilder<CodeAction> result, Document document, State state, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateVariable\IGenerateVariableService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateVariableAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (2)
46CodeAction.Create( 60CodeAction.Create(
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (2)
54using var _ = ArrayBuilder<CodeAction>.GetInstance(out var codeActions); 59codeActions.Add(CodeAction.Create(
src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (2)
17protected abstract Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken); 28var codeAction = await GetCodeFixAsync(root, node, context.Document, diagnostic, context.CancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
67CodeAction.Create( 78CodeAction.Create(
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
39CodeAction.Create(
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
31CodeAction.Create(
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (2)
28public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext) 42return CodeAction.Create(
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
33context.RegisterCodeFix(CodeAction.Create(
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
33context.RegisterCodeFix(CodeAction.Create(
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (3)
66CodeAction.Create( 78CodeAction.Create( 90CodeAction.Create(
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
55CodeAction.Create(
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (1)
34CodeAction.Create(
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
48CodeAction.Create(
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (5)
15using static Microsoft.CodeAnalysis.CodeActions.CodeAction; 41protected ImmutableArray<CodeAction> GetUpgradeProjectCodeActions(CodeFixContext context) 47var result = new List<CodeAction>(); 58var fixOneProject = ProjectOptionsChangeAction.Create(fixOneProjectTitle, 67var fixAllProjects = ProjectOptionsChangeAction.Create(fixAllProjectsTitle,
src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (1)
42CodeAction.Create(title, GetDocumentUpdater(context), title),
SyncNamespaces\AbstractSyncNamespacesService.cs (2)
112CodeAction? action = null; 141var fixAllAction = await fixAllProvider.GetFixAsync(fixAllContext).ConfigureAwait(false);
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
78context.RegisterCodeFix(CodeAction.SolutionChangeAction.Create( 386var cleanedDocument = await CodeAction.CleanupSyntaxAsync(
UseAutoProperty\UseAutoPropertyFixAllProvider.cs (1)
27public override Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (3)
111CodeAction.Create( 118CodeAction.Create( 127CodeAction.Create(
Wrapping\AbstractCodeActionComputer.cs (4)
271public async Task<ImmutableArray<CodeAction>> GetTopLevelCodeActionsAsync(CancellationToken cancellationToken) 278using var result = TemporaryArray<CodeAction>.Empty; 297var sorted = WrapItemsAction.SortActionsByMostRecentlyUsed(ImmutableArray<CodeAction>.CastUp(wrappingActions)); 302result.Add(CodeAction.Create(
Wrapping\ICodeActionComputer.cs (1)
17Task<ImmutableArray<CodeAction>> GetTopLevelCodeActionsAsync(CancellationToken cancellationToken);
Wrapping\WrapItemsAction.cs (4)
11using static Microsoft.CodeAnalysis.CodeActions.CodeAction; 50public static ImmutableArray<CodeAction> SortActionsByMostRecentlyUsed(ImmutableArray<CodeAction> codeActions) 81private static string GetSortTitle(CodeAction codeAction)
Microsoft.CodeAnalysis.LanguageServer.Protocol (42)
Features\UnifiedSuggestions\UnifiedSuggestedActions\IFixAllCodeFixSuggestedAction.cs (1)
18CodeAction OriginalCodeAction { get; }
Features\UnifiedSuggestions\UnifiedSuggestedActions\IFixAllCodeRefactoringSuggestedAction.cs (1)
16CodeAction OriginalCodeAction { get; }
Features\UnifiedSuggestions\UnifiedSuggestedActions\IUnifiedSuggestedAction.cs (1)
16CodeAction OriginalCodeAction { get; }
Features\UnifiedSuggestions\UnifiedSuggestedActions\UnifiedCodeFixSuggestedAction.cs (1)
25CodeAction codeAction,
Features\UnifiedSuggestions\UnifiedSuggestedActions\UnifiedCodeRefactoringSuggestedAction.cs (1)
23CodeAction codeAction,
Features\UnifiedSuggestions\UnifiedSuggestedActions\UnifiedFixAllCodeFixSuggestedAction.cs (1)
23CodeAction codeAction,
Features\UnifiedSuggestions\UnifiedSuggestedActions\UnifiedFixAllCodeRefactoringSuggestedAction.cs (1)
21CodeAction codeAction,
Features\UnifiedSuggestions\UnifiedSuggestedActions\UnifiedSuggestedAction.cs (2)
13internal class UnifiedSuggestedAction(Workspace workspace, CodeAction codeAction, CodeActionPriority codeActionPriority) : IUnifiedSuggestedAction 17public CodeAction OriginalCodeAction { get; } = codeAction;
Features\UnifiedSuggestions\UnifiedSuggestedActions\UnifiedSuggestedActionWithNestedActions.cs (1)
22CodeAction codeAction,
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (12)
21using static Microsoft.CodeAnalysis.CodeActions.CodeAction; 120Task<UnifiedSuggestedActionSet?> GetFixAllSuggestedActionSetAsync(CodeAction codeAction) 133Func<CodeAction, Task<UnifiedSuggestedActionSet?>> getFixAllSuggestedActionSetAsync, 145async Task<IUnifiedSuggestedAction> GetUnifiedSuggestedActionAsync(Solution originalSolution, CodeAction action, CodeFix fix) 150foreach (var nestedAction in action.NestedActions) 209CodeAction action, 424private static bool IsTopLevelSuppressionAction(CodeAction action) 427private static bool IsBulkConfigurationAction(CodeAction action) 479bool IsActionAndSpanApplicable((CodeAction action, TextSpan? applicableSpan) actionAndSpan) 539async Task<IUnifiedSuggestedAction> GetUnifiedSuggestedActionSetAsync(CodeAction codeAction, TextSpan? applicableToSpan, TextSpan selection, CancellationToken cancellationToken) 544foreach (var nestedAction in codeAction.NestedActions) 578CodeAction action,
Handler\CodeActions\CodeActionFixAllResolveHandler.cs (1)
54var codeActionToResolve = CodeActionHelpers.GetCodeActionToResolve(data.CodeActionPath, codeActions, isFixAllAction: true);
Handler\CodeActions\CodeActionHelpers.cs (18)
21using CodeAction = Microsoft.CodeAnalysis.CodeActions.CodeAction; 105|| suggestedAction.OriginalCodeAction.Tags.Contains(CodeAction.RequiresNonDocumentChange); 115var codeAction = suggestedAction.OriginalCodeAction; 149var codeAction = suggestedAction.OriginalCodeAction; 177CodeAction codeAction, 231var codeAction = suggestedAction.OriginalCodeAction; 311public static async Task<ImmutableArray<CodeAction>> GetCodeActionsAsync( 324var _ = ArrayBuilder<CodeAction>.GetInstance(out var codeActions); 349private static CodeAction GetNestedActionsFromActionSet(IUnifiedSuggestedAction suggestedAction, string? fixAllScope) 351var codeAction = suggestedAction.OriginalCodeAction; 357using var _ = ArrayBuilder<CodeAction>.GetInstance(out var nestedActions); 370return CodeAction.Create( 374private static void GetFixAllActionsFromActionSet(IUnifiedSuggestedAction suggestedAction, ArrayBuilder<CodeAction> codeActions, string? fixAllScope) 376var codeAction = suggestedAction.OriginalCodeAction; 445public static CodeAction GetCodeActionToResolve(string[] codeActionPath, ImmutableArray<CodeAction> codeActions, bool isFixAllAction) 447CodeAction? matchingAction = null; 464matchingAction = matchingActions.Single(action => isFixAllAction ? action is FixAllCodeAction : action is CodeAction);
Handler\CodeActions\CodeActionResolveHandler.cs (1)
86var codeActionToResolve = CodeActionHelpers.GetCodeActionToResolve(data.CodeActionPath, codeActions, isFixAllAction: false);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (7)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\CodeFixContextExtensions.cs (4)
16internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, Diagnostic diagnostic) 18foreach (var action in actions) 27internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, ImmutableArray<Diagnostic> diagnostics) 31foreach (var action in actions)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
58=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey), context.Diagnostics); 61=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey, priority), context.Diagnostics);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringContextExtensions.cs (1)
22where TCodeAction : CodeAction
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (3)
AnnotatePublicApiFix.cs (1)
201public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
DeclarePublicApiFix.cs (1)
352public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
NullableEnablePublicApiFix.cs (1)
121public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Services\ConvertTupleToStructCodeRefactoringProvider\RemoteConvertTupleToStructCodeRefactoringService.cs (1)
85var cleaned = await CodeAction.CleanupDocumentAsync(document, options, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.TestAnalyzerReference (1)
NonSourceFileRefactoring.cs (1)
23context.RegisterRefactoring(CodeAction.Create(nameof(NonSourceFileRefactoring),
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (12)
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.vb (1)
32Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.vb (1)
34Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateConversionCodeFixProvider.vb (1)
34Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateParameterizedMemberCodeFixProvider.vb (1)
53Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateVariable\VisualBasicGenerateVariableCodeFixProvider.vb (2)
37Protected Overrides Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 45Return ImmutableArray(Of CodeAction).Empty
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (3)
40Protected Overrides Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction) 42Return SpecializedTasks.Null(Of CodeAction)() 51CodeAction.Create(
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (3)
42Protected Overrides Async Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction) 99Return CodeAction.Create(title, Function(c) Task.FromResult(document.WithSyntaxRoot(root)), title) 107Return CodeAction.Create(title, Function(c) Task.FromResult(document.WithSyntaxRoot(root)), title)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (6)
src\Analyzers\VisualBasic\Tests\AddExplicitCast\AddExplicitCastTests.vb (2)
20Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
src\Analyzers\VisualBasic\Tests\AddParameter\AddParameterTests.vb (2)
21Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
src\Analyzers\VisualBasic\Tests\AliasAmbiguousType\AliasAmbiguousTypeTests.vb (2)
20Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
Microsoft.CodeAnalysis.VisualBasic.Features (38)
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (3)
85CodeAction.Create( 96CodeAction.Create( 107CodeAction.Create(
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (5)
52Dim result As CodeAction = Nothing 76Private Shared Async Function GenerateEventFromAddRemoveHandlerAsync(document As Document, handlerStatement As AddRemoveHandlerStatementSyntax, cancellationToken As CancellationToken) As Task(Of CodeAction) 125cancellationToken As CancellationToken) As Task(Of CodeAction) 241Private Shared Async Function GenerateEventFromImplementsAsync(document As Document, node As QualifiedNameSyntax, cancellationToken As CancellationToken) As Task(Of CodeAction) 314Private Shared Async Function GenerateEventFromHandlesAsync(document As Document, handlesClauseItem As HandlesClauseItemSyntax, cancellationToken As CancellationToken) As Task(Of CodeAction)
CodeFixes\GenerateType\GenerateTypeCodeFixProvider.vb (1)
42Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (8)
85Dim codeActions As List(Of CodeAction) = Nothing 94Private Sub CreateContinueCodeActions(document As SemanticDocument, node As SyntaxNode, enclosingblocks As IEnumerable(Of SyntaxNode), ByRef codeActions As List(Of CodeAction), cancellationToken As CancellationToken) 104codeActions = New List(Of CodeAction) 126Private Sub CreateExitCodeActions(document As SemanticDocument, node As SyntaxNode, enclosingblocks As IEnumerable(Of SyntaxNode), ByRef codeActions As List(Of CodeAction), cancellationToken As CancellationToken) 136codeActions = New List(Of CodeAction) 310codeActions As IList(Of CodeAction)) 320codeActions As IList(Of CodeAction)) 325Private Shared Sub CreateReplaceTokenKeywordActions(blockKinds As IEnumerable(Of SyntaxKind), invalidToken As SyntaxToken, document As Document, codeActions As List(Of CodeAction))
CodeFixes\IncorrectFunctionReturnType\IncorrectFunctionReturnTypeCodeFixProvider.vb (3)
79Private Shared Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, rewrittenNode As SyntaxNode, cancellationToken As CancellationToken) As Task(Of IEnumerable(Of CodeAction)) 84Return {CodeAction.Create( 90Return SpecializedCollections.EmptyEnumerable(Of CodeAction)()
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.vb (4)
65Dim result = SpecializedCollections.EmptyEnumerable(Of CodeAction)() 101Private Shared Function CreateActionForImports(document As Document, node As ImportsStatementSyntax, root As CompilationUnitSyntax, cancellationToken As CancellationToken) As IEnumerable(Of CodeAction) 123Private Shared Function CreateActionForOptions(document As Document, node As OptionStatementSyntax, root As CompilationUnitSyntax, cancellationToken As CancellationToken) As IEnumerable(Of CodeAction) 139Private Shared Function CreateActionForAttribute(document As Document, node As AttributesStatementSyntax, root As CompilationUnitSyntax, cancellationToken As CancellationToken) As IEnumerable(Of CodeAction)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (1)
61CodeAction.Create(
RemoveSharedFromModuleMembers\VisualBasicRemoveSharedFromModuleMembersCodeFixProvider.vb (1)
52CodeAction.Create(
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.vb (1)
32Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.vb (1)
34Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateConversionCodeFixProvider.vb (1)
34Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateParameterizedMemberCodeFixProvider.vb (1)
53Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateVariable\VisualBasicGenerateVariableCodeFixProvider.vb (2)
37Protected Overrides Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 45Return ImmutableArray(Of CodeAction).Empty
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (3)
40Protected Overrides Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction) 42Return SpecializedTasks.Null(Of CodeAction)() 51CodeAction.Create(
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (3)
42Protected Overrides Async Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction) 99Return CodeAction.Create(title, Function(c) Task.FromResult(document.WithSyntaxRoot(root)), title) 107Return CodeAction.Create(title, Function(c) Task.FromResult(document.WithSyntaxRoot(root)), title)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (44)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersTests.vb (26)
37test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 68test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 105test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 140test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 175test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 205test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 247test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 289test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 561test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 605test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 649test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 703test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 753test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 796test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 840test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 875test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 910test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 945test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 980test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 1015test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 1051test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 1087test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 1122test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 1157test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 1192test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier) 1227test.CodeActionVerifier = Sub(codeAction As CodeAction, verifier As IVerifier)
ConvertAnonymousType\ConvertAnonymousTypeToTupleTests.vb (2)
20Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
ConvertNumericLiteral\ConvertNumericLiteralTests.vb (2)
20Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
Diagnostics\Suppression\SuppressionTests.vb (2)
22Protected Overrides Function MassageActions(ByVal actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
FullyQualify\FullyQualifyTests.vb (2)
22Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
GenerateComparisonOperators\GenerateComparisonOperatorsTests.vb (2)
20Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
GenerateVariable\GenerateVariableTests.vb (2)
20Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
IntroduceVariable\IntroduceVariableTests.vb (2)
21Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
SpellCheck\SpellCheckTests.vb (2)
22Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
Wrapping\AbstractParameterWrappingTests.vb (2)
20Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
Microsoft.CodeAnalysis.Workspaces (143)
CodeActions\Annotations\NavigationAnnotation.cs (1)
14/// to the transformations performed by the <see cref="CodeAction"/> infrastructure.
CodeActions\CodeAction.cs (56)
109private bool IsNonProgressApiOverridden(Dictionary<Type, bool> dictionary, Func<CodeAction, bool> computeResult) 123static codeAction => new Func<CancellationToken, Task<IEnumerable<CodeActionOperation>>>(codeAction.ComputeOperationsAsync).Method.DeclaringType != typeof(CodeAction)); 131static codeAction => new Func<CancellationToken, Task<Solution?>>(codeAction.GetChangedSolutionAsync).Method.DeclaringType != typeof(CodeAction)); 153/// Child actions contained within this <see cref="CodeAction"/>. Can be presented in a host to provide more 154/// potential solution actions to a particular problem. To create a <see cref="CodeAction"/> with nested 155/// actions, use <see cref="Create(string, ImmutableArray{CodeAction}, bool)"/>. 157public virtual ImmutableArray<CodeAction> NestedActions 164internal virtual ImmutableArray<CodeAction> AdditionalPreviewFlavors => []; 169internal ImmutableArray<CodeAction> NestedCodeActions 178/// nested options with less steps. To create a <see cref="CodeAction"/> with nested actions, use <see 179/// cref="Create(string, ImmutableArray{CodeAction}, bool)"/>. 279/// Override this method if you want to implement a <see cref="CodeAction"/> subclass that includes custom <see 293/// Override this method if you want to implement a <see cref="CodeAction"/> subclass that includes custom <see 320/// Override this method if you want to implement a <see cref="CodeAction"/> that has a set of preview operations that are different 328/// cref="CodeAction"/> subclass that changes more than one document. Override <see 340/// cref="CodeAction"/> subclass that changes more than one document. Prefer overriding this method over <see 369/// cref="CodeAction"/> subclass that changes a single document. Override <see 385/// cref="CodeAction"/> subclass that changes a single document. Prefer overriding this method over <see 450/// <param name="changedSolution">The solution changed by the <see cref="CodeAction"/>.</param> 462/// <param name="document">The document changed by the <see cref="CodeAction"/>.</param> 479/// Creates a <see cref="CodeAction"/> for a change to a single <see cref="Document"/>. 482/// <param name="title">Title of the <see cref="CodeAction"/>.</param> 484/// <param name="equivalenceKey">Optional value used to determine the equivalence of the <see cref="CodeAction"/> with other <see cref="CodeAction"/>s. See <see cref="CodeAction.EquivalenceKey"/>.</param> 486public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey) 490internal static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey) 496public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 501public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 513/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>. 516/// <param name="title">Title of the <see cref="CodeAction"/>.</param> 518/// <param name="equivalenceKey">Optional value used to determine the equivalence of the <see cref="CodeAction"/> with other <see cref="CodeAction"/>s. See <see cref="CodeAction.EquivalenceKey"/>.</param> 520public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey) 524/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>. 527/// <param name="title">Title of the <see cref="CodeAction"/>.</param> 529/// <param name="equivalenceKey">Optional value used to determine the equivalence of the <see cref="CodeAction"/> with other <see cref="CodeAction"/>s. See <see cref="CodeAction.EquivalenceKey"/>.</param> 531public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 536public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 539internal static CodeAction Create( 552/// Creates a <see cref="CodeAction"/> representing a group of code actions. 554/// <param name="title">Title of the <see cref="CodeAction"/> group.</param> 559public static CodeAction Create(string title, ImmutableArray<CodeAction> nestedActions, bool isInlinable) 562/// <inheritdoc cref="Create(string, ImmutableArray{CodeAction}, bool)"/> 565public static CodeAction Create(string title, ImmutableArray<CodeAction> nestedActions, bool isInlinable, CodeActionPriority priority = CodeActionPriority.Default) 600ImmutableArray<CodeAction> nestedActions, 613ImmutableArray<CodeAction> nestedActions, 622ImmutableArray<CodeAction> nestedActions, 629public sealed override ImmutableArray<CodeAction> NestedActions { get; } 631private static string? ComputeEquivalenceKey(ImmutableArray<CodeAction> nestedActions) 636foreach (var action in nestedActions)
CodeActions\CodeActionPriority.cs (1)
34/// High priority code action. Note: High priority is simply a request on the part of a <see cref="CodeAction"/>.
CodeActions\CodeActionRequestPriority.cs (1)
69if (priority == CodeActionRequestPriority.High && !customTags.Contains(CodeAction.CanBeHighPriorityTag))
CodeActions\CodeActionWithOptions.cs (4)
15/// A <see cref="CodeAction"/> that can vary with user specified options. Override one of <see 30/// Gets the <see cref="CodeActionOperation"/>'s for this <see cref="CodeAction"/> given the specified options. 62/// Override this method to compute the operations that implement this <see cref="CodeAction"/>. 70/// Override this method to compute the operations that implement this <see cref="CodeAction"/>. Prefer
CodeActions\Operations\ApplyChangesOperation.cs (5)
19/// <see cref="CodeAction.GetOperationsAsync(CancellationToken)"/> may return at most one 21/// <see cref="ApplyChangesOperation"/>s, but if a <see cref="CodeAction"/> requires custom 24/// <description><text>Implement a custom <see cref="CodeAction"/> and <see cref="CodeActionOperation"/>s</text></description> 25/// <description><text>Do not return any <see cref="ApplyChangesOperation"/> from <see cref="CodeAction.GetOperationsAsync(CancellationToken)"/></text></description> 28/// <description><text>Produce a preview for <see cref="CodeAction.GetPreviewOperationsAsync(CancellationToken)"/>
CodeFixes\CodeFix.cs (6)
16/// that holds on to a <see cref="CodeAction"/> and the set of 17/// <see cref="Diagnostic"/>s that this <see cref="CodeAction"/> will fix. 22public readonly CodeAction Action; 37/// cref="CodeFixContext.RegisterCodeFix(CodeAction, IEnumerable{Diagnostic})"/>). This could change in the future, 43public CodeFix(Project project, CodeAction action, Diagnostic diagnostic) 50public CodeFix(Project project, CodeAction action, ImmutableArray<Diagnostic> diagnostics)
CodeFixes\CodeFixContext.cs (15)
21private readonly Action<CodeAction, ImmutableArray<Diagnostic>> _registerCodeFix; 77/// <param name="registerCodeFix">Delegate to register a <see cref="CodeAction"/> fixing a subset of diagnostics.</param> 89Action<CodeAction, ImmutableArray<Diagnostic>> registerCodeFix, 109/// <param name="registerCodeFix">Delegate to register a <see cref="CodeAction"/> fixing a subset of diagnostics.</param> 120Action<CodeAction, ImmutableArray<Diagnostic>> registerCodeFix, 140/// <param name="registerCodeFix">Delegate to register a <see cref="CodeAction"/> fixing a subset of diagnostics.</param> 147Action<CodeAction, ImmutableArray<Diagnostic>> registerCodeFix, 165/// <param name="registerCodeFix">Delegate to register a <see cref="CodeAction"/> fixing a subset of diagnostics.</param> 171Action<CodeAction, ImmutableArray<Diagnostic>> registerCodeFix, 184/// <param name="action">The <see cref="CodeAction"/> that will be invoked to apply the fix.</param> 186public void RegisterCodeFix(CodeAction action, Diagnostic diagnostic) 204/// <param name="action">The <see cref="CodeAction"/> that will be invoked to apply the fix.</param> 206public void RegisterCodeFix(CodeAction action, IEnumerable<Diagnostic> diagnostics) 219/// <param name="action">The <see cref="CodeAction"/> that will be invoked to apply the fix.</param> 221public void RegisterCodeFix(CodeAction action, ImmutableArray<Diagnostic> diagnostics)
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (8)
33public override Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext) 153using var _2 = ArrayBuilder<CodeAction>.GetInstance(out var codeActions); 164foreach (var codeAction in codeActions) 229private static Action<CodeAction, ImmutableArray<Diagnostic>> GetRegisterCodeFixAction( 230string? codeActionEquivalenceKey, ArrayBuilder<CodeAction> codeActions) 234using var _ = ArrayBuilder<CodeAction>.GetInstance(out var builder); 236while (builder.TryPop(out var currentAction)) 245foreach (var nestedAction in currentAction.NestedActions)
CodeFixes\FixAllOccurrences\DocumentBasedFixAllProvider.cs (2)
38/// Produce a suitable title for the fix-all <see cref="CodeAction"/> this type creates in <see 63public sealed override Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
CodeFixes\FixAllOccurrences\FixAllContext.cs (8)
59/// The <see cref="CodeAction.EquivalenceKey"/> value expected of a <see cref="CodeAction"/> participating in this fix all. 103/// <param name="codeActionEquivalenceKey">The <see cref="CodeAction.EquivalenceKey"/> value expected of a <see cref="CodeAction"/> participating in this fix all.</param> 140/// <param name="codeActionEquivalenceKey">The <see cref="CodeAction.EquivalenceKey"/> value expected of a <see cref="CodeAction"/> participating in this fix all.</param> 176/// <param name="codeActionEquivalenceKey">The <see cref="CodeAction.EquivalenceKey"/> value expected of a <see cref="CodeAction"/> participating in this fix all.</param>
CodeFixes\FixAllOccurrences\FixAllProvider.cs (2)
42public abstract Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext); 99Task<CodeAction?> IFixAllProvider.GetFixAsync(IFixAllContext fixAllContext)
CodeFixes\FixAllOccurrences\NoOpFixAllProvider.cs (2)
25public override Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext) 26=> Task.FromResult<CodeAction?>(null);
CodeFixes\Supression\IConfigurationFixProvider.cs (2)
25/// Gets one or more add suppression, remove suppression, or configuration fixes for the specified diagnostics represented as a list of <see cref="CodeAction"/>'s. 31/// Gets one or more add suppression, remove suppression, or configuration fixes for the specified no-location diagnostics represented as a list of <see cref="CodeAction"/>'s.
CodeFixesAndRefactorings\DefaultFixAllProviderHelpers.cs (2)
23public static async Task<CodeAction?> GetFixAsync<TFixAllContext>( 46return CodeAction.Create(
CodeFixesAndRefactorings\DocumentBasedFixAllProviderHelpers.cs (2)
47var cleanedSolution = await CodeAction.PostProcessChangesAsync( 53var cleanedTexts = await CodeAction.GetAllChangedOrAddedDocumentIds(originalSolution, cleanedSolution)
CodeFixesAndRefactorings\IFixAllProvider.cs (1)
26Task<CodeAction?> GetFixAsync(IFixAllContext fixAllContext);
CodeRefactorings\CodeRefactoringContext.cs (9)
56private readonly Action<CodeAction, TextSpan?> _registerRefactoring; 65Action<CodeAction> registerRefactoring, 76Action<CodeAction> registerRefactoring, 87Action<CodeAction, TextSpan?> registerRefactoring, 101/// <param name="action">The <see cref="CodeAction"/> that will be invoked to apply the refactoring.</param> 102public void RegisterRefactoring(CodeAction action) => RegisterRefactoring(action, applicableToSpan: null); // We could pass this.Span as applicableToSpan instead but that would cause these refactorings to always be closest to current selection 107/// <param name="action">The <see cref="CodeAction"/> that will be invoked to apply the refactoring.</param> 113internal void RegisterRefactoring(CodeAction action, TextSpan applicableToSpan) => RegisterRefactoring(action, new Nullable<TextSpan>(applicableToSpan)); 115private void RegisterRefactoring(CodeAction action, TextSpan? applicableToSpan)
CodeRefactorings\FixAllOccurences\DocumentBasedFixAllProvider.cs (2)
39/// Produce a suitable title for the fix-all <see cref="CodeAction"/> this type creates in <see 64public sealed override Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
CodeRefactorings\FixAllOccurences\FixAllContext.cs (2)
44/// The <see cref="CodeAction.EquivalenceKey"/> value expected of a <see cref="CodeAction"/> participating in this fix all.
CodeRefactorings\FixAllOccurences\FixAllProvider.cs (2)
35public abstract Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext); 38Task<CodeAction?> IFixAllProvider.GetFixAsync(IFixAllContext fixAllContext)
CodeRefactorings\FixAllOccurences\FixAllState.cs (2)
40CodeAction codeAction) 52CodeAction codeAction)
Simplification\Simplifier.cs (1)
54/// The annotation <see cref="CodeAction.CleanupDocumentAsync"/> used to identify sub trees to look for symbol annotations on.
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\CodeFixContextExtensions.cs (4)
16internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, Diagnostic diagnostic) 18foreach (var action in actions) 27internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, ImmutableArray<Diagnostic> diagnostics) 31foreach (var action in actions)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
58=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey), context.Diagnostics); 61=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey, priority), context.Diagnostics);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringContextExtensions.cs (1)
22where TCodeAction : CodeAction
Microsoft.CodeAnalysis.Workspaces.UnitTests (4)
BatchFixAllProviderTests.cs (4)
89var fixes = new List<CodeAction>(); 92fixes.Add(CodeAction.Create( 100fixes = [CodeAction.Create("Container", [.. fixes], isInlinable: false)]; 103foreach (var fix in fixes)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
481var actions = new List<CodeAction>();
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
481var actions = new List<CodeAction>();
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
481var actions = new List<CodeAction>();
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
481var actions = new List<CodeAction>();
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
481var actions = new List<CodeAction>();
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
481var actions = new List<CodeAction>();
Microsoft.Interop.ComInterfaceGenerator (5)
Analyzers\AddMarshalAsToElementFixer.cs (1)
43CodeAction.Create(
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (4)
138CodeAction.Create( 147CodeAction.Create( 169public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext) 180return CodeAction.Create(codeFixProvider.GetDiagnosticTitle(options),
Microsoft.Interop.LibraryImportGenerator (8)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (1)
37CodeAction.Create(
Analyzers\CustomMarshallerAttributeFixer.cs (3)
29public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext) 84return CodeAction.Create(SR.AddMissingCustomTypeMarshallerMembers, ct => Task.FromResult(symbolEditor.ChangedSolution)); 122CodeAction.Create(
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (4)
138CodeAction.Create( 147CodeAction.Create( 169public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext) 180return CodeAction.Create(codeFixProvider.GetDiagnosticTitle(options),
Microsoft.ML.InternalCodeAnalyzer (6)
ContractsCheckNameofFixProvider.cs (5)
64context.RegisterCodeFix(CodeAction.Create(Title, 101context.RegisterCodeFix(CodeAction.Create(Title, 120context.RegisterCodeFix(CodeAction.Create(Title, 148context.RegisterCodeFix(CodeAction.Create(Title, 158context.RegisterCodeFix(CodeAction.Create(Title,
NameFixProvider.cs (1)
98context.RegisterCodeFix(CodeAction.Create(PrivateTitle,
Microsoft.VisualStudio.LanguageServices.Xaml (1)
CodeFixes\RemoveUnnecessaryUsings\XamlRemoveUnnecessaryUsingsCodeFixProvider.cs (1)
46CodeAction.Create(
Roslyn.Diagnostics.Analyzers (15)
AbstractApplyTraitToClass`1.cs (1)
61CodeAction.Create(
AbstractCreateTestAccessor`1.cs (1)
49CodeAction.Create(
AbstractExposeMemberForTesting`1.cs (1)
70CodeAction.Create(
AbstractRunIterations`1.cs (1)
75CodeAction.Create(
ExportedPartsShouldHaveImportingConstructorCodeFixProvider.cs (1)
69CodeAction.Create(
ImportingConstructorShouldBeObsoleteCodeFixProvider.cs (1)
75CodeAction.Create(
PartsExportedWithMEFv2MustBeMarkedAsShared.Fixer.cs (1)
49CodeAction.Create(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\CodeFixContextExtensions.cs (4)
16internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, Diagnostic diagnostic) 18foreach (var action in actions) 27internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, ImmutableArray<Diagnostic> diagnostics) 31foreach (var action in actions)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
58=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey), context.Diagnostics); 61=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey, priority), context.Diagnostics);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringContextExtensions.cs (1)
22where TCodeAction : CodeAction
TestExportsShouldNotBeDiscoverableCodeFixProvider.cs (1)
40CodeAction.Create(
Roslyn.Diagnostics.CSharp.Analyzers (5)
CSharpAvoidOptSuffixForNullableEnableCodeCodeFixProvider.cs (1)
57CodeAction.Create(
CSharpDoNotUseDebugAssertForInterpolatedStringsFixer.cs (1)
48CodeAction.Create(
NumberCommentsRefactoring.cs (2)
44var action = CodeAction.Create(
PreferNullLiteralCodeFixProvider.cs (1)
38CodeAction.Create(
Roslyn.VisualStudio.DiagnosticsWindow (1)
Panels\TelemetryPanel.xaml.cs (1)
131var codeActionType = typeof(CodeAction);
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
58CodeAction.Create(
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (1)
50CodeAction.Create(
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (1)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (1)
56CodeAction.Create(
Text.Analyzers (7)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\CodeFixContextExtensions.cs (4)
16internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, Diagnostic diagnostic) 18foreach (var action in actions) 27internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, ImmutableArray<Diagnostic> diagnostics) 31foreach (var action in actions)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
58=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey), context.Diagnostics); 61=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey, priority), context.Diagnostics);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringContextExtensions.cs (1)
22where TCodeAction : CodeAction