SyntaxEditor Class

Definition

An editor for making changes to a syntax tree.

public ref class SyntaxEditor
public class SyntaxEditor
type SyntaxEditor = class
Public Class SyntaxEditor
Inheritance
SyntaxEditor
Derived

Constructors

SyntaxEditor(SyntaxNode, Workspace)

Creates a new SyntaxEditor instance.

Properties

Generator

A SyntaxGenerator to use to create and change SyntaxNode's.

OriginalRoot

The SyntaxNode that was specified when the SyntaxEditor was constructed.

Methods

GetChangedRoot()

Returns the changed root node.

InsertAfter(SyntaxNode, IEnumerable<SyntaxNode>)

Insert the new nodes after the specified node already existing in the tree.

InsertAfter(SyntaxNode, SyntaxNode)

Insert the new node after the specified node already existing in the tree.

InsertBefore(SyntaxNode, IEnumerable<SyntaxNode>)

Insert the new nodes before the specified node already existing in the tree.

InsertBefore(SyntaxNode, SyntaxNode)

Insert the new node before the specified node already existing in the tree.

RemoveNode(SyntaxNode)

Remove the node from the tree.

RemoveNode(SyntaxNode, SyntaxRemoveOptions)

Remove the node from the tree.

ReplaceNode(SyntaxNode, Func<SyntaxNode,SyntaxGenerator,SyntaxNode>)

Replace the specified node with a node produced by the function.

ReplaceNode(SyntaxNode, SyntaxNode)

Replace the specified node with a different node.

TrackNode(SyntaxNode)

Makes sure the node is tracked, even if it is not changed.

Extension Methods

AddAttribute(SyntaxEditor, SyntaxNode, SyntaxNode)
AddAttributeArgument(SyntaxEditor, SyntaxNode, SyntaxNode)
AddBaseType(SyntaxEditor, SyntaxNode, SyntaxNode)
AddInterfaceType(SyntaxEditor, SyntaxNode, SyntaxNode)
AddMember(SyntaxEditor, SyntaxNode, SyntaxNode)
AddParameter(SyntaxEditor, SyntaxNode, SyntaxNode)
AddReturnAttribute(SyntaxEditor, SyntaxNode, SyntaxNode)
InsertMembers(SyntaxEditor, SyntaxNode, Int32, IEnumerable<SyntaxNode>)
InsertParameter(SyntaxEditor, SyntaxNode, Int32, SyntaxNode)
SetAccessibility(SyntaxEditor, SyntaxNode, Accessibility)
SetExpression(SyntaxEditor, SyntaxNode, SyntaxNode)
SetGetAccessorStatements(SyntaxEditor, SyntaxNode, IEnumerable<SyntaxNode>)
SetModifiers(SyntaxEditor, SyntaxNode, DeclarationModifiers)
SetName(SyntaxEditor, SyntaxNode, String)
SetSetAccessorStatements(SyntaxEditor, SyntaxNode, IEnumerable<SyntaxNode>)
SetStatements(SyntaxEditor, SyntaxNode, IEnumerable<SyntaxNode>)
SetType(SyntaxEditor, SyntaxNode, SyntaxNode)
SetTypeConstraint(SyntaxEditor, SyntaxNode, String, SpecialTypeConstraintKind, IEnumerable<SyntaxNode>)
SetTypeParameters(SyntaxEditor, SyntaxNode, IEnumerable<String>)

Applies to