Delen via


SyntaxNode.IsIncrementallyIdenticalTo(SyntaxNode) Method

Definition

Returns true if these two nodes are considered "incrementally identical". An incrementally identical node occurs when a SyntaxTree is incrementally parsed using WithChangedText(SourceText) and the incremental parser is able to take the node from the original tree and use it in its entirety in the new tree. In this case, the ToFullString() of each node will be the same, though they could have different parents, and may occur at different positions in their respective trees. If two nodes are incrementally identical, all children of each node will be incrementally identical as well.

public bool IsIncrementallyIdenticalTo (Microsoft.CodeAnalysis.SyntaxNode? other);
member this.IsIncrementallyIdenticalTo : Microsoft.CodeAnalysis.SyntaxNode -> bool
Public Function IsIncrementallyIdenticalTo (other As SyntaxNode) As Boolean

Parameters

other
SyntaxNode

Returns

Remarks

Incrementally identical nodes can also appear within the same syntax tree, or syntax trees that did not arise from WithChangedText(SourceText). This can happen as the parser is allowed to construct parse trees from shared nodes for efficiency. In all these cases though, it will still remain true that the incrementally identical nodes could have different parents and may occur at different positions in their respective trees.

Applies to