36 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)
80private sealed class FixAllAdditionalDocumentChangeAction : CodeAction
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (1)
15private sealed partial class GenerateParameterizedMemberCodeAction : CodeAction
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (1)
26private sealed partial class GenerateVariableCodeAction : 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.EditorFeatures (1)
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCodeAction.cs (1)
24private sealed class RenameTrackingCodeAction : CodeAction
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Suggestions\PreviewChanges\PreviewChangesCodeAction.cs (1)
18private sealed class PreviewChangesCodeAction : CodeAction
Microsoft.CodeAnalysis.Features (9)
AddImport\CodeActions\AddImportCodeAction.cs (1)
20internal abstract class AddImportCodeAction : CodeAction
CodeFixes\Suppression\NestedSuppressionCodeAction.cs (1)
9internal abstract class NestedSuppressionCodeAction : CodeAction
CodeFixesAndRefactorings\AbstractFixAllCodeAction.cs (1)
18internal abstract class AbstractFixAllCodeAction : CodeAction
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeCodeAction.cs (1)
15private sealed class MoveTypeCodeAction : 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\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (1)
15private sealed partial class GenerateParameterizedMemberCodeAction : CodeAction
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (1)
26private sealed partial class GenerateVariableCodeAction : CodeAction
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
111private sealed class FixNameCodeAction : CodeAction
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (4)
AnnotatePublicApiFix.cs (1)
94private class FixAllAdditionalDocumentChangeAction : CodeAction
DeclarePublicApiFix.cs (2)
188internal class AdditionalDocumentChangeAction : CodeAction 209private 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)
17Inherits CodeAction
CodeRefactorings\RemoveStatementCodeAction.vb (1)
11Inherits CodeAction
Microsoft.CodeAnalysis.Workspaces (1)
CodeActions\CodeActionWithOptions.cs (1)
19public abstract class CodeActionWithOptions : CodeAction
1143 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);
ILLink.CodeFixProvider (2)
BaseAttributeCodeFixProvider.cs (1)
46 context.RegisterCodeFix (CodeAction.Create (
DynamicallyAccessedMembersCodeFixProvider.cs (1)
108 context.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 (11)
Authorization\AddAuthorizationBuilderFixer.cs (1)
47CodeAction.Create(title,
Dependencies\AddPackageFixer.cs (2)
89var codeAction = await TryCreateCodeActionAsync( 112internal virtual async Task<CodeAction?> 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 (19)
FixAnalyzers\FixerWithFixAllAnalyzer.cs (2)
152/// Map of invocations from code fix providers to invocations that create a code action using the static "Create" methods on <see cref="CodeAction"/>. 157/// 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)
53context.RegisterCodeFix(CodeAction.Create(title, c => AddMethodAsync(context.Document, classDecl, c), equivalenceKey: title), context.Diagnostics);
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (5)
51CodeAction? codeAction = null; 57codeAction = CodeAction.Create( 68codeAction = CodeAction.Create( 75codeAction = CodeAction.Create( 84codeAction = CodeAction.Create(
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.FixAllProvider.cs (1)
25public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
MetaAnalyzers\Fixers\ApplyDiagnosticAnalyzerAttributeFix.cs (2)
54var fix = CodeAction.Create(
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (2)
43CodeAction.Create( 51CodeAction.Create(
MetaAnalyzers\Fixers\ConfigureGeneratedCodeAnalysisFix.cs (1)
32CodeAction.Create(
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.cs (2)
66var codeAction = CodeAction.Create(
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.CustomFixAllProvider.cs (1)
29public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
MetaAnalyzers\Fixers\EnableConcurrentExecutionFix.cs (1)
31CodeAction.Create(
MetaAnalyzers\Fixers\PreferIsKindFix.cs (1)
27CodeAction.Create(
Microsoft.CodeAnalysis.Analyzers.UnitTests (2)
FixAnalyzers\FixerWithFixAllAnalyzerTests.cs (2)
731return VerifyCS.Diagnostic(FixerWithFixAllAnalyzer.OverrideCodeActionEquivalenceKeyRule).WithLocation(line, column).WithArguments(customCodeActionName, nameof(CodeAction.EquivalenceKey)); 738return VerifyVB.Diagnostic(FixerWithFixAllAnalyzer.OverrideCodeActionEquivalenceKeyRule).WithLocation(line, column).WithArguments(customCodeActionName, nameof(CodeAction.EquivalenceKey));
Microsoft.CodeAnalysis.CodeStyle.Fixes (95)
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (1)
45CodeAction.Create(
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (3)
89using var actions = TemporaryArray<CodeAction>.Empty; 96actions.Add(CodeAction.Create( 111CodeAction.Create(AnalyzersResources.Add_explicit_cast, actions.ToImmutableAndClear(), isInlinable: false),
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (12)
255ImmutableArray<CodeAction> NestByOverload() 257var builder = new FixedSizeArrayBuilder<CodeAction>(codeFixData.Length); 262var codeAction = CodeAction.Create( 273codeAction = CodeAction.Create( 277CodeAction.Create( 292ImmutableArray<CodeAction> NestByCascading() 294using var builder = TemporaryArray<CodeAction>.Empty; 299return CodeAction.Create(title, data.CreateChangedSolutionNonCascading, equivalenceKey: title); 307return CodeAction.Create(title, data.CreateChangedSolutionCascading!, equivalenceKey: title); 315builder.Add(CodeAction.Create(nestedNonCascadingTitle, nonCascadingActions, isInlinable: false)); 322builder.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)
51using var _ = ArrayBuilder<CodeAction>.GetInstance(out var actions); 57actions.Add(CodeAction.Create( 69CodeAction.Create(
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (3)
300static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey) 302var codeAction = CodeAction.Create(title, action, equivalenceKey, CodeActionPriority.High);
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (3)
30var codeAction = await GetCodeActionAsync( 52private async Task<CodeAction?> GetCodeActionAsync( 63return 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)
45var codeAction = CodeAction.Create(
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (5)
79public async Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 90using var result = TemporaryArray<CodeAction>.Empty; 95result.Add(CodeAction.Create( 104result.Add(CodeAction.Create( 111result.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\GenerateDefaultConstructorsCodeAction.cs (1)
28ImmutableArray<IMethodSymbol> constructors) : CodeAction
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\IGenerateDefaultConstructorsService.cs (1)
16Task<ImmutableArray<CodeAction>> GenerateDefaultConstructorsAsync(
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (1)
17private sealed partial class GenerateEnumMemberCodeAction(Document document, State state) : CodeAction
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)
26protected 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\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
19private 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\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)
67CodeAction.Create( 79CodeAction.Create( 91CodeAction.Create(
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
55CodeAction.Create(
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (1)
29CodeAction.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)
49=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey), context.Diagnostics); 52=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey, priority), context.Diagnostics);
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 (36)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAtStartCodeFixProvider.cs (1)
48CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (2)
43var documentChangeAction = CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (1)
45CodeAction.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\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.AddNewKeywordAction.cs (1)
23private sealed class AddNewKeywordAction(Document document, SyntaxNode node) : CodeAction
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)
37protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken) 110return 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)
36CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
36CodeAction.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)
41CodeAction.Create( 48CodeAction.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)
46CodeAction.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)
32protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (32)
CodeActions\AddUsing\AddUsingNuGetTests.cs (2)
47protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
CodeActions\ApplyChangesOperationTests.cs (2)
246var refactorings = new List<CodeAction>(); 251var 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)
93var codeActions = new List<CodeAction>(); 103EditorTestWorkspace workspace, CodeRefactoringProvider provider, List<CodeAction> codeActions, 113var 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 (4)
99var renameFileAction = actions.Any(action => action is not CodeAction.SolutionChangeAction); 113var moveFileActions = actions.Where(a => a is not CodeAction.SolutionChangeAction); 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 (90)
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)
63context.RegisterRefactoring(CodeAction.Create(
ConvertProgram\ConvertToProgramMainCodeRefactoringProvider.cs (1)
56context.RegisterRefactoring(CodeAction.Create(
ConvertProgram\ConvertToTopLevelStatementsCodeRefactoringProvider.cs (1)
59context.RegisterRefactoring(CodeAction.Create(
ConvertToExtension\ConvertToExtensionCodeRefactoringProvider.cs (2)
165context.RegisterRefactoring(CodeAction.Create( 182context.RegisterRefactoring(CodeAction.Create(
ConvertToRawString\ConvertStringToRawStringCodeRefactoringProvider.cs (3)
92CodeAction.Create( 102CodeAction.Create( 112CodeAction.Create(
Copilot\CSharpCopilotCodeFixProvider.cs (1)
89private static CodeAction? TryGetFix(
Copilot\CSharpCopilotCodeFixProvider.DismissChangesCodeAction.cs (1)
21private sealed class CopilotDismissChangesCodeAction(SyntaxNode originalMethodNode, Diagnostic diagnostic) : CodeAction
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)
77var codeAction = CodeAction.Create( 103using var nestedActions = TemporaryArray<CodeAction>.Empty; 109nestedActions.Add(CodeAction.Create( 117nestedActions.Add(CodeAction.Create( 123context.RegisterRefactoring(CodeAction.Create(
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (10)
132static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Solution>> createSolution) 133=> CodeAction.Create(title, createSolution, title); 135IEnumerable<CodeAction> HandleExistingFieldOrProperty() 143IEnumerable<CodeAction> HandleNoExistingFieldOrProperty() 154var fieldAction = CreateCodeAction( 157var propertyAction = CreateCodeAction( 167var allFieldsAction = CodeAction.Create( 170var 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)
43var documentChangeAction = CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (1)
45CodeAction.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\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.AddNewKeywordAction.cs (1)
23private sealed class AddNewKeywordAction(Document document, SyntaxNode node) : CodeAction
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)
37protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken) 110return 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)
36CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
36CodeAction.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)
41CodeAction.Create( 48CodeAction.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)
46CodeAction.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)
31public override Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
51CodeAction.Create(
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockFixAllProvider.cs (1)
23public override Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (2)
122CodeAction.Create( 135CodeAction.Create(
UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeRefactoringProvider.cs (6)
89private static async Task<ImmutableArray<CodeAction>> ComputeOpposingRefactoringsWhenAnalyzerActiveAsync( 145private static async Task<ImmutableArray<CodeAction>> ComputeAllRefactoringsWhenAnalyzerInactiveAsync( 161private static async Task<ImmutableArray<CodeAction>> ComputeRefactoringsAsync( 170using var result = TemporaryArray<CodeAction>.Empty; 175result.Add(CodeAction.Create( 184result.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)
69CodeAction? codeAction = null; 86void 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)
756protected override async Task<(ImmutableArray<CodeAction>, CodeAction actionToInvoke)> GetCodeActionsAsync(TestWorkspace workspace, TestParameters parameters) 998protected 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)
32protected override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
Wrapping\AbstractWrappingTests.cs (2)
23protected sealed override ImmutableArray<CodeAction> MassageActions(ImmutableArray<CodeAction> actions)
Microsoft.CodeAnalysis.EditorFeatures (4)
RenameTracking\RenameTrackingCodeRefactoringProvider.cs (1)
32this.CustomTags = this.CustomTags.Add(CodeAction.CanBeHighPriorityTag);
RenameTracking\RenameTrackingTaggerProvider.cs (1)
102public static (CodeAction action, TextSpan renameSpan) TryGetCodeAction(
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCodeAction.cs (1)
50this.CustomTags = this.CustomTags.Add(CodeAction.CanBeHighPriorityTag);
RenameTracking\RenameTrackingTaggerProvider.StateMachine.cs (1)
286internal (CodeAction action, TextSpan renameSpan) TryGetCodeAction(
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (12)
CodeFixes\CodeFixServiceTests.cs (5)
423CodeAction.Create( 807context.RegisterCodeFix(CodeAction.Create(_name, ct => Task.FromResult(context.Document)), fixableDiagnostics); 851CodeAction.Create( 934context.RegisterCodeFix(CodeAction.Create(Title, 1230CodeAction.Create(Title,
CodeFixes\ErrorCases\CodeFixExceptionInGetFixAllProvider.cs (1)
28context.RegisterCodeFix(CodeAction.Create("Do Nothing", token => Task.FromResult(context.Document)), context.Diagnostics[0]);
CodeRefactorings\CodeRefactoringServiceTest.cs (3)
67context.RegisterRefactoring(CodeAction.Create($"Blocking=false", _ => Task.FromResult<Document>(null))); 120context.RegisterRefactoring(CodeAction.Create( 241context.RegisterRefactoring(CodeAction.Create(Title,
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (1)
111context.RegisterRefactoring(CodeAction.Create("Description", _ => Task.FromResult(newSolution)), context.Span);
RenameTracking\RenameTrackingTestState.cs (2)
166public async Task<CodeAction> TryGetCodeActionAsync(TextSpan? textSpan = null) 172var actions = new List<CodeAction>();
Microsoft.CodeAnalysis.EditorFeatures.Wpf (22)
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 (2)
29CodeAction originalCodeAction, 31ICopilotCodeAnalysisService copilotCodeAnalysisService) : CodeAction
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.EditorFeatures2.UnitTests (16)
CodeFixes\CodeFixServiceTests.vb (2)
230context.RegisterCodeFix(CodeAction.Create("FIX_TEST0000", Function(ct) Task.FromResult(context.Document.WithSyntaxRoot(root))), context.Diagnostics) 255context.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)
270glyphTags:=WellKnownTagArrays.CSharpProject.Add(CodeAction.RequiresNonDocumentChange), 358glyphTags:=WellKnownTagArrays.CSharpProject.Add(CodeAction.RequiresNonDocumentChange), 405glyphTags:=WellKnownTagArrays.CSharpProject.Add(CodeAction.RequiresNonDocumentChange), 451glyphTags:=WellKnownTagArrays.VisualBasicProject.Add(CodeAction.RequiresNonDocumentChange), 530glyphTags:=WellKnownTagArrays.CSharpProject.Add(CodeAction.RequiresNonDocumentChange),
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
123context.RegisterCodeFix(CodeAction.Create("Request serialization permission", Function(ct) Task.FromResult(newSln)), context.Diagnostics)
Diagnostics\GenerateFromUsage\GenerateVariableCrossLanguageTests.vb (2)
29Protected Overrides Function MassageActions(actions As IList(Of CodeAction)) As IList(Of CodeAction)
Rename\InlineRenameTests.vb (1)
1279Dim 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 (1)
src\Tools\ExternalAccess\Razor\Shared\Cohost\Handlers\CodeActions.cs (1)
59var codeActionToResolve = CodeActionHelpers.GetCodeActionToResolve(data.CodeActionPath, codeActions, isFixAllAction: false);
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (1)
src\Tools\ExternalAccess\Razor\Shared\Cohost\Handlers\CodeActions.cs (1)
59var codeActionToResolve = CodeActionHelpers.GetCodeActionToResolve(data.CodeActionPath, codeActions, isFixAllAction: false);
Microsoft.CodeAnalysis.Features (388)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (1)
32bool useSubMenuName) : CodeAction
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.cs (6)
79private static ImmutableArray<CodeAction> GetGroupedActions(AddConstructorParameterResult result) 81using var _ = ArrayBuilder<CodeAction>.GetInstance(out var actions); 86actions.Add(CodeAction.Create( 88result.RequiredParameterActions.Cast<AddConstructorParametersCodeAction, CodeAction>(), 92actions.Add(CodeAction.Create( 94result.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)
54this.CustomTags = this.CustomTags.Add(CodeAction.CanBeHighPriorityTag);
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (1)
53var solutionChangeAction = SolutionChangeAction.Create("", GetUpdatedSolutionAsync, "");
AddImport\CodeActions\InstallWithPackageManagerCodeAction.cs (1)
18string packageName) : CodeAction
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 (2)
43private static async Task<ImmutableArray<CodeAction>> GetAddReferencesCodeActionsAsync(CodeFixContext context, ISet<AssemblyIdentity> uniqueIdentities) 45var result = ArrayBuilder<CodeAction>.GetInstance();
AddMissingReference\AddMissingReferenceCodeAction.cs (2)
15internal sealed class AddMissingReferenceCodeAction(Project project, string title, ProjectReference? projectReferenceToAdd, AssemblyIdentity missingAssemblyIdentity) : CodeAction 29public static async Task<CodeAction> CreateAsync(Project project, AssemblyIdentity missingAssemblyIdentity, CancellationToken cancellationToken)
AddPackage\AbstractAddPackageCodeFixProvider.cs (2)
28protected async Task<ImmutableArray<CodeAction>> GetAddPackagesCodeActionsAsync( 49var codeActions = ArrayBuilder<CodeAction>.GetInstance();
AddPackage\InstallPackageDirectlyCodeAction.cs (1)
21bool isLocal) : CodeAction
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\InstallWithPackageManagerCodeAction.cs (1)
15IPackageInstallerService installerService, string packageName) : CodeAction
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 (3)
20using static Microsoft.CodeAnalysis.CodeActions.CodeAction; 76using var _ = ArrayBuilder<CodeAction>.GetInstance(out var nestedActions); 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 (25)
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); 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)
201CodeAction 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\CodeRefactoringContextExtensions.cs (1)
22where TCodeAction : CodeAction
CodeRefactorings\CodeRefactoringService.cs (1)
222using var _ = ArrayBuilder<(CodeAction action, TextSpan? applicableToSpan)>.GetInstance(out var actions);
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (7)
53private static async Task<ImmutableArray<CodeAction>> GetCodeActionsAsync( 59using var _ = ArrayBuilder<CodeAction>.GetInstance(out var actions); 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)
74var solutionChangeAction = CodeAction.Create(
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
26private sealed class MoveFileCodeAction(State state, ImmutableArray<string> newFolders) : CodeAction
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)
51CodeAction.Create( 61CodeAction.Create(
ConvertLinq\AbstractConvertLinqQueryToForEachProvider.cs (1)
47CodeAction.Create(
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (2)
114CodeAction.Create( 137CodeAction.Create(
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (4)
71using var result = TemporaryArray<CodeAction>.Empty; 104context.RegisterRefactoring(CodeAction.Create( 110CodeAction CreateCodeAction(string text, string title) 111=> 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)
96CodeAction.Create( 108CodeAction.Create( 117ImmutableArray<CodeAction> CreateChildActions( 125using var scopes = TemporaryArray<CodeAction>.Empty; 169private CodeAction CreateAction(Document document, TextSpan span, Scope scope, bool isRecord) 170=> CodeAction.Create(GetTitle(scope), c => ConvertToStructAsync(document, span, scope, isRecord, c), scope.ToString());
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDetectionCodeFixProvider.cs (1)
38CodeAction.Create(
EncapsulateField\AbstractEncapsulateFieldService.cs (8)
57public async Task<ImmutableArray<CodeAction>> GetEncapsulateFieldCodeActionsAsync(Document document, TextSpan span, CancellationToken cancellationToken) 68using var builder = TemporaryArray<CodeAction>.Empty; 81private ImmutableArray<CodeAction> EncapsulateAllFields(Document document, ImmutableArray<IFieldSymbol> fields) 83CodeAction.Create( 87CodeAction.Create( 93private ImmutableArray<CodeAction> EncapsulateOneField(Document document, IFieldSymbol field) 98CodeAction.Create( 102CodeAction.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)
96context.RegisterRefactoring(CodeAction.Create( 103using var _2 = ArrayBuilder<CodeAction>.GetInstance(out var nestedActions); 109nestedActions.Add(CodeAction.Create( 115context.RegisterRefactoring(CodeAction.Create(
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.ConstructorDelegatingCodeAction.cs (1)
25bool addNullChecks) : CodeAction
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (9)
81using var _1 = ArrayBuilder<CodeAction>.GetInstance(out var actions); 109Document priorDocument, CodeAction codeAction, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 128CodeAction action, 153Action<CodeAction, TextSpan> registerSingleAction, 154Action<ImmutableArray<CodeAction>> registerMultipleActions, 189private async Task<(CodeAction CodeAction, TextSpan ApplicableToSpan)?> HandleNonSelectionAsync( 264public async Task<ImmutableArray<CodeAction>> GenerateConstructorFromMembersAsync( 281private ImmutableArray<CodeAction> GetCodeActions(Document document, State state, bool addNullChecks) 283using var result = TemporaryArray<CodeAction>.Empty;
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.FieldDelegatingCodeAction.cs (1)
25bool addNullChecks) : CodeAction
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.GenerateConstructorWithDialogCodeAction.cs (1)
101: (CodeAction)new FieldDelegatingCodeAction(_service, _document, state, addNullChecks);
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (1)
29bool generateOperators) : CodeAction
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 (7)
60protected override async Task<ImmutableArray<CodeAction>> GetRefactoringsForAllParametersAsync( 85return [CodeAction.Create( 91protected override async Task<ImmutableArray<CodeAction>> GetRefactoringsForSingleParameterAsync( 109using var result = TemporaryArray<CodeAction>.Empty; 110result.Add(CodeAction.Create( 119result.Add(CodeAction.Create( 124result.Add(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)
36protected abstract Task<ImmutableArray<CodeAction>> GetRefactoringsForAllParametersAsync( 45protected abstract Task<ImmutableArray<CodeAction>> GetRefactoringsForSingleParameterAsync(
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (7)
240var nestedCodeAction = CodeAction.Create( 248private ImmutableArray<CodeAction> GenerateCodeActions(Document document, 258var codeActionRemovesCallee = CodeAction.Create( 273var codeActionKeepsCallee = CodeAction.Create(
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (8)
99CodeAction.Create( 108CodeAction.Create( 139private async Task<(ImmutableArray<CodeAction> actions, ImmutableArray<CodeAction> actionsAllOccurrences)?> GetActionsAsync(Document document, 148using var actionsBuilder = TemporaryArray<CodeAction>.Empty; 149using var actionsBuilderAllOccurrences = TemporaryArray<CodeAction>.Empty; 182CodeAction CreateNewCodeAction(string actionName, bool allOccurrences, IntroduceParameterCodeActionKind selectedCodeAction) 184return CodeAction.Create(
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (2)
79CodeAction.Create( 93CodeAction.Create(
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (2)
55CodeAction.Create( 63CodeAction.Create(
IntroduceVariable\AbstractIntroduceVariableService.cs (6)
61public async Task<CodeAction> IntroduceVariableAsync( 81return CodeAction.Create(title, actions, isInlinable: true); 88private (string title, ImmutableArray<CodeAction>) CreateActions(State state, CancellationToken cancellationToken) 93using var _ = ArrayBuilder<CodeAction>.GetInstance(out var actions); 99private string AddActionsAndGetTitle(State state, ArrayBuilder<CodeAction> actions, CancellationToken cancellationToken) 189private void CreateConstantFieldActions(State state, ArrayBuilder<CodeAction> actions, CancellationToken cancellationToken)
IntroduceVariable\IIntroduceVariableService.cs (1)
16Task<CodeAction> IntroduceVariableAsync(Document document, TextSpan textSpan, CodeCleanupOptions options, CancellationToken cancellationToken);
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(
PreferFrameworkType\PreferFrameworkTypeCodeFixProvider.cs (1)
36CodeAction.Create(
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (1)
61context.RegisterRefactoring(CodeAction.Create(
PullMemberUp\MembersPuller.cs (2)
24using static Microsoft.CodeAnalysis.CodeActions.CodeAction; 37public 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)
89using var actions = TemporaryArray<CodeAction>.Empty; 96actions.Add(CodeAction.Create( 111CodeAction.Create(AnalyzersResources.Add_explicit_cast, actions.ToImmutableAndClear(), isInlinable: false),
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (12)
255ImmutableArray<CodeAction> NestByOverload() 257var builder = new FixedSizeArrayBuilder<CodeAction>(codeFixData.Length); 262var codeAction = CodeAction.Create( 273codeAction = CodeAction.Create( 277CodeAction.Create( 292ImmutableArray<CodeAction> NestByCascading() 294using var builder = TemporaryArray<CodeAction>.Empty; 299return CodeAction.Create(title, data.CreateChangedSolutionNonCascading, equivalenceKey: title); 307return CodeAction.Create(title, data.CreateChangedSolutionCascading!, equivalenceKey: title); 315builder.Add(CodeAction.Create(nestedNonCascadingTitle, nonCascadingActions, isInlinable: false)); 322builder.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)
51using var _ = ArrayBuilder<CodeAction>.GetInstance(out var actions); 57actions.Add(CodeAction.Create( 69CodeAction.Create(
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (5)
51this.CustomTags = this.CustomTags.Add(CodeAction.CanBeHighPriorityTag); 300static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey) 302var codeAction = CodeAction.Create(title, action, equivalenceKey, CodeActionPriority.High); 306codeAction.CustomTags = codeAction.CustomTags.Add(CodeAction.CanBeHighPriorityTag);
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (3)
30var codeAction = await GetCodeActionAsync( 52private async Task<CodeAction?> GetCodeActionAsync( 63return 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); 45var codeAction = CodeAction.Create( 53codeAction.CustomTags = codeAction.CustomTags.Add(CodeAction.CanBeHighPriorityTag);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (5)
79public async Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 90using var result = TemporaryArray<CodeAction>.Empty; 95result.Add(CodeAction.Create( 104result.Add(CodeAction.Create( 111result.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\GenerateDefaultConstructorsCodeAction.cs (1)
28ImmutableArray<IMethodSymbol> constructors) : CodeAction
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\IGenerateDefaultConstructorsService.cs (1)
16Task<ImmutableArray<CodeAction>> GenerateDefaultConstructorsAsync(
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (1)
17private sealed partial class GenerateEnumMemberCodeAction(Document document, State state) : CodeAction
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)
26protected 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\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
19private 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\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 (1)
17protected abstract Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken);
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)
67CodeAction.Create( 79CodeAction.Create( 91CodeAction.Create(
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
55CodeAction.Create(
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (1)
29CodeAction.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),
SyncNamespaces\AbstractSyncNamespacesService.cs (2)
112CodeAction? action = null; 141var fixAllAction = await fixAllProvider.GetFixAsync(fixAllContext).ConfigureAwait(false);
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
77context.RegisterCodeFix(CodeAction.SolutionChangeAction.Create( 385var cleanedDocument = await CodeAction.CleanupSyntaxAsync(
UseAutoProperty\UseAutoPropertyFixAllProvider.cs (1)
26public override Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (3)
112CodeAction.Create( 119CodeAction.Create( 128CodeAction.Create(
Wrapping\AbstractCodeActionComputer.cs (4)
270public async Task<ImmutableArray<CodeAction>> GetTopLevelCodeActionsAsync(CancellationToken cancellationToken) 277using var result = TemporaryArray<CodeAction>.Empty; 296var sorted = WrapItemsAction.SortActionsByMostRecentlyUsed(ImmutableArray<CodeAction>.CastUp(wrappingActions)); 301result.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 (43)
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)
17public CodeAction OriginalCodeAction { get; } 21public UnifiedSuggestedAction(Workspace workspace, CodeAction codeAction, CodeActionPriority codeActionPriority)
Features\UnifiedSuggestions\UnifiedSuggestedActions\UnifiedSuggestedActionWithNestedActions.cs (1)
22CodeAction codeAction,
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (13)
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, 322var suppressOrConfigureCodeAction = NoChangeAction.Create(CodeFixesResources.Suppress_or_configure_issues, nameof(CodeFixesResources.Suppress_or_configure_issues)); 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.PublicApiAnalyzers.CodeFixes (3)
AnnotatePublicApiFix.cs (1)
185public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
DeclarePublicApiFix.cs (1)
330public 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)
34Protected 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)
35Protected 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)
35Protected 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)
54Protected 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)
38Protected Overrides Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 46Return 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)
43Protected 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)
78Private Shared Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, rewrittenNode As SyntaxNode, cancellationToken As CancellationToken) As Task(Of IEnumerable(Of CodeAction)) 83Return {CodeAction.Create( 89Return SpecializedCollections.EmptyEnumerable(Of CodeAction)()
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.vb (4)
64Dim result = SpecializedCollections.EmptyEnumerable(Of CodeAction)() 100Private Shared Function CreateActionForImports(document As Document, node As ImportsStatementSyntax, root As CompilationUnitSyntax, cancellationToken As CancellationToken) As IEnumerable(Of CodeAction) 122Private Shared Function CreateActionForOptions(document As Document, node As OptionStatementSyntax, root As CompilationUnitSyntax, cancellationToken As CancellationToken) As IEnumerable(Of CodeAction) 138Private Shared Function CreateActionForAttribute(document As Document, node As AttributesStatementSyntax, root As CompilationUnitSyntax, cancellationToken As CancellationToken) As IEnumerable(Of CodeAction)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (1)
62CodeAction.Create(
RemoveSharedFromModuleMembers\VisualBasicRemoveSharedFromModuleMembersCodeFixProvider.vb (1)
52CodeAction.Create(
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.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\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.vb (1)
35Protected 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)
35Protected 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)
54Protected 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)
38Protected Overrides Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 46Return 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)
21Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
ConvertNumericLiteral\ConvertNumericLiteralTests.vb (2)
21Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
Diagnostics\Suppression\SuppressionTests.vb (2)
23Protected 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)
21Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
GenerateVariable\GenerateVariableTests.vb (2)
21Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
IntroduceVariable\IntroduceVariableTests.vb (2)
22Protected 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)
21Protected Overrides Function MassageActions(actions As ImmutableArray(Of CodeAction)) As ImmutableArray(Of CodeAction)
Microsoft.CodeAnalysis.Workspaces (142)
CodeActions\Annotations\NavigationAnnotation.cs (1)
14/// to the transformations performed by the <see cref="CodeAction"/> infrastructure.
CodeActions\CodeAction.cs (56)
105private bool IsNonProgressApiOverridden(Dictionary<Type, bool> dictionary, Func<CodeAction, bool> computeResult) 119static codeAction => new Func<CancellationToken, Task<IEnumerable<CodeActionOperation>>>(codeAction.ComputeOperationsAsync).Method.DeclaringType != typeof(CodeAction)); 127static codeAction => new Func<CancellationToken, Task<Solution?>>(codeAction.GetChangedSolutionAsync).Method.DeclaringType != typeof(CodeAction)); 149/// Child actions contained within this <see cref="CodeAction"/>. Can be presented in a host to provide more 150/// potential solution actions to a particular problem. To create a <see cref="CodeAction"/> with nested 151/// actions, use <see cref="Create(string, ImmutableArray{CodeAction}, bool)"/>. 153public virtual ImmutableArray<CodeAction> NestedActions 160internal virtual ImmutableArray<CodeAction> AdditionalPreviewFlavors => []; 165internal ImmutableArray<CodeAction> NestedCodeActions 174/// nested options with less steps. To create a <see cref="CodeAction"/> with nested actions, use <see 175/// cref="Create(string, ImmutableArray{CodeAction}, bool)"/>. 275/// Override this method if you want to implement a <see cref="CodeAction"/> subclass that includes custom <see 289/// Override this method if you want to implement a <see cref="CodeAction"/> subclass that includes custom <see 316/// Override this method if you want to implement a <see cref="CodeAction"/> that has a set of preview operations that are different 324/// cref="CodeAction"/> subclass that changes more than one document. Override <see 336/// cref="CodeAction"/> subclass that changes more than one document. Prefer overriding this method over <see 365/// cref="CodeAction"/> subclass that changes a single document. Override <see 381/// cref="CodeAction"/> subclass that changes a single document. Prefer overriding this method over <see 447/// <param name="changedSolution">The solution changed by the <see cref="CodeAction"/>.</param> 473/// <param name="document">The document changed by the <see cref="CodeAction"/>.</param> 490/// Creates a <see cref="CodeAction"/> for a change to a single <see cref="Document"/>. 493/// <param name="title">Title of the <see cref="CodeAction"/>.</param> 495/// <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> 497public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey) 501internal static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey) 507public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 512public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 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) 535/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>. 538/// <param name="title">Title of the <see cref="CodeAction"/>.</param> 540/// <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> 542public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 547public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 559/// Creates a <see cref="CodeAction"/> representing a group of code actions. 561/// <param name="title">Title of the <see cref="CodeAction"/> group.</param> 566public static CodeAction Create(string title, ImmutableArray<CodeAction> nestedActions, bool isInlinable) 569/// <inheritdoc cref="Create(string, ImmutableArray{CodeAction}, bool)"/> 572public static CodeAction Create(string title, ImmutableArray<CodeAction> nestedActions, bool isInlinable, CodeActionPriority priority = CodeActionPriority.Default) 587bool createdFromFactoryMethod) : CodeAction 607ImmutableArray<CodeAction> nestedActions, 620ImmutableArray<CodeAction> nestedActions, 629ImmutableArray<CodeAction> nestedActions, 636public sealed override ImmutableArray<CodeAction> NestedActions { get; } 638private static string? ComputeEquivalenceKey(ImmutableArray<CodeAction> nestedActions) 643foreach (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. 105/// <param name="codeActionEquivalenceKey">The <see cref="CodeAction.EquivalenceKey"/> value expected of a <see cref="CodeAction"/> participating in this fix all.</param> 142/// <param name="codeActionEquivalenceKey">The <see cref="CodeAction.EquivalenceKey"/> value expected of a <see cref="CodeAction"/> participating in this fix all.</param> 178/// <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)
45public abstract Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext); 94Task<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>( 47return CodeAction.Create(
CodeFixesAndRefactorings\DocumentBasedFixAllProviderHelpers.cs (2)
47var cleanedSolution = await CodeAction.CleanSyntaxAndSemanticsAsync( 56var cleanedTexts = await CodeAction.GetAllChangedOrAddedDocumentIds(originalSolution, cleanedSolution)
CodeFixesAndRefactorings\IFixAllProvider.cs (1)
18Task<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)
40public abstract Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext); 43Task<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)
49=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey), context.Diagnostics); 52=> context.RegisterCodeFix(CodeAction.Create(title, GetDocumentUpdater(context, diagnostic), equivalenceKey, priority), context.Diagnostics);
Microsoft.CodeAnalysis.Workspaces.UnitTests (4)
BatchFixAllProviderTests.cs (4)
95var fixes = new List<CodeAction>(); 98fixes.Add(CodeAction.Create( 106fixes = [CodeAction.Create("Container", [.. fixes], isInlinable: false)]; 109foreach (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 (8)
AbstractApplyTraitToClass`1.cs (1)
61CodeAction.Create(
AbstractCreateTestAccessor`1.cs (1)
49CodeAction.Create(
AbstractExposeMemberForTesting`1.cs (1)
70CodeAction.Create(
AbstractRunIterations`1.cs (1)
74CodeAction.Create(
ExportedPartsShouldHaveImportingConstructorCodeFixProvider.cs (1)
68CodeAction.Create(
ImportingConstructorShouldBeObsoleteCodeFixProvider.cs (1)
77CodeAction.Create(
PartsExportedWithMEFv2MustBeMarkedAsShared.Fixer.cs (1)
49CodeAction.Create(
TestExportsShouldNotBeDiscoverableCodeFixProvider.cs (1)
39CodeAction.Create(
Roslyn.Diagnostics.CSharp.Analyzers (5)
CSharpAvoidOptSuffixForNullableEnableCodeCodeFixProvider.cs (1)
57CodeAction.Create(
CSharpDoNotUseDebugAssertForInterpolatedStringsFixer.cs (1)
48CodeAction.Create(
NumberCommentsRefactoring.cs (2)
43var 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(