Click or drag to resize

SyntaxNodeFindNode Method



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.

Namespace:  Microsoft.CodeAnalysis
Assembly:  Microsoft.CodeAnalysis (in Microsoft.CodeAnalysis.dll) Version: 2.3.0-dev-56735-00. Commit Hash: <developer build>
Syntax
public SyntaxNode FindNode(
	TextSpan span,
	bool findInsideTrivia = false,
	bool getInnermostNodeForTie = false
)

Parameters

span
Type: Microsoft.CodeAnalysis.TextTextSpan
findInsideTrivia (Optional)
Type: SystemBoolean
getInnermostNodeForTie (Optional)
Type: SystemBoolean

Return Value

Type: SyntaxNode
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionThis exception is thrown if FullSpan doesn't contain the given span.
Remarks
TODO: This should probably be reimplemented with ChildThatContainsPosition(Int32)
See Also