Click or drag to resize

SyntaxNode Methods



The SyntaxNode type exposes the following members.

Methods
  NameDescription
Public methodAncestors
Public methodAncestorsAndSelf
Public methodChildNodes
Gets a list of the child nodes in prefix document order.
Public methodChildNodesAndTokens
The list of child nodes and tokens of this node, where each element is a SyntaxNodeOrToken instance.
Public methodChildThatContainsPosition
Public methodChildTokens
Gets a list of the direct child tokens of this node.
Public methodContains
Determines if the specified node is a descendant of this node.
Public methodCopyAnnotationsToT
Copies all SyntaxAnnotations, if any, from this SyntaxNode instance and attaches them to a new instance based on node.
Public methodDescendantNodes(Void, SyntaxNode)
Public methodDescendantNodes(Void, SyntaxNode, TextSpan)
Public methodDescendantNodesAndSelf(Void, SyntaxNode)
Public methodDescendantNodesAndSelf(Void, SyntaxNode, TextSpan)
Public methodDescendantNodesAndTokens(Void, SyntaxNodeOrToken)
Public methodDescendantNodesAndTokens(Void, SyntaxNodeOrToken, TextSpan)
Public methodDescendantNodesAndTokensAndSelf(Void, SyntaxNodeOrToken)
Public methodDescendantNodesAndTokensAndSelf(Void, SyntaxNodeOrToken, TextSpan)
Public methodDescendantTokens(Void, SyntaxToken)
Public methodDescendantTokens(Void, SyntaxToken, TextSpan)
Public methodDescendantTrivia(Void, SyntaxTrivia)
Public methodDescendantTrivia(Void, SyntaxTrivia, TextSpan)
Protected methodEquivalentToCore
Determine if this node is structurally equivalent to another.
Public methodFindNode
Finds the node with the smallest FullSpan that contains span. getInnermostNodeForTie is used to determine the behavior in case of a tie (i.e. a node having the same span as its parent). If getInnermostNodeForTie is true, then it returns lowest descending node encompassing the given span. Otherwise, it returns the outermost node encompassing the given span.
Public methodFindToken
Finds a descendant token of this node whose span includes the supplied position.
Protected methodFindTokenCore(Int32, Boolean)
Finds a descendant token of this node whose span includes the supplied position.
Protected methodFindTokenCore(Int32, FuncT, TResult)
Public methodFindTrivia(Int32, Boolean)
Finds a descendant trivia of this node whose span includes the supplied position.
Public methodFindTrivia(Int32, FuncT, TResult)
Protected methodFindTriviaCore
Finds a descendant trivia of this node whose span includes the supplied position.
Public methodFirstAncestorOrSelfTNode
Public methodGetAnnotatedNodes(Void)
Public methodGetAnnotatedNodesAndTokens(Void)
Public methodGetAnnotatedTokens(Void)
Public methodGetAnnotatedTrivia(Void)
Public methodGetAnnotations(Void)
Public methodGetDiagnostics
Gets a list of all the diagnostics in the sub tree that has this node as its root. This method does not filter diagnostics based on #pragmas and compiler options like nowarn, warnaserror etc.
Public methodGetFirstToken
Gets the first token of the tree rooted by this node. Skips zero-width tokens.
Public methodGetLastToken
Gets the last token of the tree rooted by this node. Skips zero-width tokens.
Public methodGetLeadingTrivia
The list of trivia that appears before this node in the source code and are attached to a token that is a descendant of this node.
Public methodGetLocation
Protected methodGetRedT
Protected methodGetRedAtZeroT
Public methodGetReference
Gets a SyntaxReference for this syntax node. CommonSyntaxReferences can be used to regain access to a syntax node without keeping the entire tree and source text in memory.
Public methodGetText
Gets the full text of this node as an new SourceText instance.
Public methodGetTrailingTrivia
The list of trivia that appears after this node in the source code and are attached to a token that is a descendant of this node.
Public methodHasAnnotation
Determines whether this node has the specific annotation.
Public methodHasAnnotations(IEnumerableT)
Public methodHasAnnotations(String)
Determines whether this node has any annotations with the specific annotation kind.
Protected methodInsertNodesInListCore
Protected methodInsertTokensInListCore
Protected methodInsertTriviaInListCore
Public methodIsEquivalentTo(SyntaxNode)
Determine whether this node is structurally equivalent to another.
Public methodIsEquivalentTo(SyntaxNode, Boolean)
Determines if two nodes are the same, disregarding trivia differences.
Protected methodIsEquivalentToCore
Determines if two nodes are the same, disregarding trivia differences.
Public methodIsPartOfStructuredTrivia
Determines whether this node is a descendant of a structured trivia.
Protected methodNormalizeWhitespaceCore
Protected methodRemoveNodesCore
Protected methodReplaceCoreTNode
Protected methodReplaceNodeInListCore
Protected methodReplaceTokenInListCore
Protected methodReplaceTriviaInListCore
Public methodSerializeTo
Public methodToFullString
Returns full string representation of this node including its leading and trailing trivia.
Public methodToString
Returns the string representation of this node, not including its leading and trailing trivia.
Public methodWriteTo
Writes the full text of this node to the specified TextWriter.
Top
Extension Methods
  NameDescription
Public Extension MethodGetCurrentNodeTNode
Gets the node within the subtree corresponding to the original tracked node. Use TrackNodes to start tracking nodes.
(Defined by SyntaxNodeExtensions.)
Public Extension MethodGetFirstDirective(FuncT, TResult)Overloaded. (Defined by VisualBasicExtensions.)
Public Extension MethodGetFirstDirective(FuncT, TResult)Overloaded. (Defined by CSharpExtensions.)
Public Extension MethodGetLastDirective(FuncT, TResult)Overloaded. (Defined by VisualBasicExtensions.)
Public Extension MethodGetLastDirective(FuncT, TResult)Overloaded. (Defined by CSharpExtensions.)
Public Extension MethodIsKind(SyntaxKind)Overloaded.
Determines if SyntaxNode is a specified kind.
(Defined by VisualBasicExtensions.)
Public Extension MethodIsKind(SyntaxKind)Overloaded. (Defined by CSharpExtensions.)
Public Extension MethodKindOverloaded.
Returns SyntaxKind for SyntaxNode from RawKind property.
(Defined by VisualBasicExtensions.)
Public Extension MethodKindOverloaded. (Defined by CSharpExtensions.)
Top
See Also