Click or drag to resize

CSharpSyntaxNodeFindToken Method

Finds a token according to the following rules: 1) If position matches the End of the node/s FullSpan and the node is CompilationUnit, then EoF is returned. 2) If node.FullSpan.Contains(position) then the token that contains given position is returned. 3) Otherwise an ArgumentOutOfRangeException is thrown

Namespace:  Microsoft.CodeAnalysis.CSharp
Assembly:  Microsoft.CodeAnalysis.CSharp (in Microsoft.CodeAnalysis.CSharp.dll) Version: 2.3.0-dev-56735-00. Commit Hash: <developer build>
public SyntaxToken FindToken(
	int position,
	bool findInsideTrivia = false


Type: SystemInt32
findInsideTrivia (Optional)
Type: SystemBoolean

Return Value

Type: SyntaxToken
See Also