86 references to ReplaceNode
ILLink.CodeFixProvider (1)
DynamicallyAccessedMembersCodeFixProvider.cs (1)
142
editor.
ReplaceNode
(targetNode, (d, g) => g.AddReturnAttributes (d, new[] { attribute }));
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (1)
23
editor.
ReplaceNode
(
src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (1)
39
editor.
ReplaceNode
(typeDeclaration,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (11)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
327
documentEditor.
ReplaceNode
(typeDeclaration, (declaration, _) =>
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
202
editor.
ReplaceNode
(
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
139
syntaxEditor.
ReplaceNode
(
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (3)
48
editor.
ReplaceNode
(
63
editor.
ReplaceNode
(
72
editor.
ReplaceNode
(
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
71
editor.
ReplaceNode
(accessorList, (current, _) => current.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (2)
69
editor.
ReplaceNode
(
75
editor.
ReplaceNode
(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (2)
207
editor.
ReplaceNode
(block, (currentBlock, _) => ((BlockSyntax)currentBlock).AddStatements(statement));
220
editor.
ReplaceNode
(
Microsoft.CodeAnalysis.CSharp.Features (14)
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
253
mainDocumentEditor.
ReplaceNode
(baseType, (current, _) => SimpleBaseType(((PrimaryConstructorBaseTypeSyntax)current).Type).WithTriviaFrom(baseType));
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
116
editor.
ReplaceNode
(
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
325
editor.
ReplaceNode
(
338
editor.
ReplaceNode
(
SplitOrMergeIfStatements\CSharpIfLikeStatementGenerator.cs (2)
136
editor.
ReplaceNode
(afterIfOrElseIf, (currentNode, _) =>
158
editor.
ReplaceNode
(elseIfClause.Parent.Parent, (currentNode, _) =>
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
327
documentEditor.
ReplaceNode
(typeDeclaration, (declaration, _) =>
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
202
editor.
ReplaceNode
(
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (3)
48
editor.
ReplaceNode
(
63
editor.
ReplaceNode
(
72
editor.
ReplaceNode
(
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
71
editor.
ReplaceNode
(accessorList, (current, _) => current.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (2)
69
editor.
ReplaceNode
(
75
editor.
ReplaceNode
(
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (2)
207
editor.
ReplaceNode
(block, (currentBlock, _) => ((BlockSyntax)currentBlock).AddStatements(statement));
220
editor.
ReplaceNode
(
Microsoft.CodeAnalysis.Features (18)
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
170
editor.
ReplaceNode
(
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
125
=> editor.
ReplaceNode
(
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (2)
376
editor.
ReplaceNode
(
449
editor.
ReplaceNode
(
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
785
editor.
ReplaceNode
(
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
413
callerNodeEditor.
ReplaceNode
(nodeToReplace, (node, generator) => inlineNode);
PullMemberUp\MembersPuller.cs (1)
346
originalMemberEditor.
ReplaceNode
(declarationSyntax, (node, generator) => generator.WithModifiers(node, DeclarationModifiers.Override));
SimplifyTypeNames\AbstractSimplifyTypeNamesCodeFixProvider.cs (1)
118
editor.
ReplaceNode
(
SplitOrMergeIfStatements\Consecutive\AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
95
editor.
ReplaceNode
(firstIfOrElseIf, (currentNode, _) => ifGenerator.WithCondition(currentNode, newCondition));
126
editor.
ReplaceNode
(
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
72
editor.
ReplaceNode
(ifOrElseIf, (currentNode, _) => ifGenerator.WithCondition(currentNode, leftCondition));
92
editor.
ReplaceNode
(ifOrElseIf, (currentNode, _) => generator.ScopeBlock([currentNode]));
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (1)
23
editor.
ReplaceNode
(
src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (1)
39
editor.
ReplaceNode
(typeDeclaration,
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
425
editor.
ReplaceNode
(expressionStatement, (node, generator) =>
src\Analyzers\Core\CodeFixes\SimplifyLinqExpression\SimplifyLinqExpressionCodeFixProvider.cs (1)
46
editor.
ReplaceNode
(invocation, (current, generator) =>
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (1)
57
editor.
ReplaceNode
(conditionalExpression,
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (1)
129
editor.
ReplaceNode
(
Microsoft.CodeAnalysis.VisualBasic.Features (3)
ReplaceMethodWithProperty\VisualBasicReplaceMethodWithPropertyService.vb (2)
185
editor.
ReplaceNode
(nameNode, Function(n, g) newName.WithIdentifier(newName.Identifier.WithAdditionalAnnotations(annotation)))
189
editor.
ReplaceNode
(
SplitOrMergeIfStatements\VisualBasicIfLikeStatementGenerator.vb (1)
183
editor.
ReplaceNode
(afterIfOrElseIf,
Microsoft.CodeAnalysis.Workspaces (25)
Editing\SymbolEditorExtensions.cs (1)
85
e.
ReplaceNode
(decl, (d, g) => g.AddBaseType(d, newBaseType));
Editing\SyntaxEditorExtensions.cs (23)
14
=> editor.
ReplaceNode
(declaration, (d, g) => g.WithAccessibility(d, accessibility));
17
=> editor.
ReplaceNode
(declaration, (d, g) => g.WithModifiers(d, modifiers));
20
=> editor.
ReplaceNode
(declaration, (d, g) => g.RemoveAllAttributes(d));
23
=> editor.
ReplaceNode
(declaration, (d, g) => g.RemoveAllComments(d));
26
=> editor.
ReplaceNode
(declaration, (d, g) => g.RemoveAllTypeInheritance(d));
29
=> editor.
ReplaceNode
(declaration, (d, g) => g.WithName(d, name));
32
=> editor.
ReplaceNode
(declaration, (d, g) => g.WithType(d, type));
35
=> editor.
ReplaceNode
(declaration, (d, g) => g.WithTypeParameters(d, typeParameters));
38
=> editor.
ReplaceNode
(declaration, (d, g) => g.WithTypeConstraint(d, typeParameterName, kind, types));
41
=> editor.
ReplaceNode
(declaration, (d, g) => g.WithExpression(d, expression));
44
=> editor.
ReplaceNode
(declaration, (d, g) => g.WithStatements(d, statements));
47
=> editor.
ReplaceNode
(declaration, (d, g) => g.WithGetAccessorStatements(d, statements));
50
=> editor.
ReplaceNode
(declaration, (d, g) => g.WithSetAccessorStatements(d, statements));
53
=> editor.
ReplaceNode
(declaration, (d, g) => g.AddParameters(d, [parameter]));
56
=> editor.
ReplaceNode
(declaration, (d, g) => g.InsertParameters(d, index, [parameter]));
59
=> editor.
ReplaceNode
(declaration, (d, g) => g.AddAttributes(d, [attribute]));
62
=> editor.
ReplaceNode
(declaration, (d, g) => g.AddReturnAttributes(d, [attribute]));
65
=> editor.
ReplaceNode
(attributeDeclaration, (d, g) => g.AddAttributeArguments(d, [attributeArgument]));
68
=> editor.
ReplaceNode
(declaration, (d, g) => g.AddMembers(d, [member]));
71
=> editor.
ReplaceNode
(declaration, (d, g) => g.InsertMembers(d, index, members));
74
=> editor.
ReplaceNode
(declaration, (d, g) => g.AddInterfaceType(d, interfaceType));
77
=> editor.
ReplaceNode
(declaration, (d, g) => g.AddBaseType(d, baseType));
80
=> editor.
ReplaceNode
(declaration, (d, g) => g.RemovePrimaryConstructor(d));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
151
editor.
ReplaceNode
(
Microsoft.Interop.ComInterfaceGenerator (3)
Analyzers\AddGeneratedComClassFixer.cs (1)
26
editor.
ReplaceNode
(node, (node, gen) =>
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (1)
138
editor.
ReplaceNode
(node, (node, gen) => gen.WithModifiers(node, gen.GetModifiers(node).WithPartial(true)));
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
236
editor.
ReplaceNode
(node, (node, gen) => gen.WithModifiers(node, gen.GetModifiers(node).WithPartial(true)));
Microsoft.Interop.LibraryImportGenerator (7)
Analyzers\ConvertToLibraryImportFixer.cs (4)
320
editor.
ReplaceNode
(invocation, WrapInvocationWithHRExceptionThrow);
325
editor.
ReplaceNode
(invocation,
358
editor.
ReplaceNode
(declaration,
377
editor.
ReplaceNode
(invocation.Parent,
Analyzers\CustomMarshallerAttributeFixer.cs (2)
348
editor.
ReplaceNode
(declaringSyntax, (declaringSyntax, gen) => gen.AddMembers(declaringSyntax, newMembers));
523
editor.
ReplaceNode
(declaringSyntax, (declaringSyntax, gen) => gen.AddMembers(declaringSyntax, newMembers));
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
236
editor.
ReplaceNode
(node, (node, gen) => gen.WithModifiers(node, gen.GetModifiers(node).WithPartial(true)));