Delen via


SyntaxToken.IsIncrementallyIdenticalTo(SyntaxToken) Method

Definition

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

public bool IsIncrementallyIdenticalTo (Microsoft.CodeAnalysis.SyntaxToken token);
member this.IsIncrementallyIdenticalTo : Microsoft.CodeAnalysis.SyntaxToken -> bool
Public Function IsIncrementallyIdenticalTo (token As SyntaxToken) As Boolean

Parameters

token
SyntaxToken

Returns

Remarks

Incrementally identical tokens 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 using shared tokens for efficiency. In all these cases though, it will still remain true that the incrementally identical tokens could have different parents and may occur at different positions in their respective trees.

Applies to