DocumentEditor Class

Definition

An editor for making changes to a document's syntax tree.

public ref class DocumentEditor : Microsoft::CodeAnalysis::Editing::SyntaxEditor
public class DocumentEditor : Microsoft.CodeAnalysis.Editing.SyntaxEditor
type DocumentEditor = class
    inherit SyntaxEditor
Public Class DocumentEditor
Inherits SyntaxEditor
Inheritance
DocumentEditor

Properties

Generator

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

(Inherited from SyntaxEditor)
OriginalDocument

The Document specified when the editor was first created.

OriginalRoot

The SyntaxNode that was specified when the SyntaxEditor was constructed.

(Inherited from SyntaxEditor)
SemanticModel

The SemanticModel of the original document.

Methods

CreateAsync(Document, CancellationToken)

Creates a new DocumentEditor instance.

GetChangedDocument()

Returns the changed Document.

GetChangedRoot()

Returns the changed root node.

(Inherited from SyntaxEditor)
InsertAfter(SyntaxNode, IEnumerable<SyntaxNode>)

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

(Inherited from SyntaxEditor)
InsertAfter(SyntaxNode, SyntaxNode)

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

(Inherited from SyntaxEditor)
InsertBefore(SyntaxNode, IEnumerable<SyntaxNode>)

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

(Inherited from SyntaxEditor)
InsertBefore(SyntaxNode, SyntaxNode)

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

(Inherited from SyntaxEditor)
RemoveNode(SyntaxNode)

Remove the node from the tree.

(Inherited from SyntaxEditor)
RemoveNode(SyntaxNode, SyntaxRemoveOptions)

Remove the node from the tree.

(Inherited from SyntaxEditor)
ReplaceNode(SyntaxNode, Func<SyntaxNode,SyntaxGenerator,SyntaxNode>)

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

(Inherited from SyntaxEditor)
ReplaceNode(SyntaxNode, SyntaxNode)

Replace the specified node with a different node.

(Inherited from SyntaxEditor)
TrackNode(SyntaxNode)

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

(Inherited from SyntaxEditor)

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