Open sandboxFocus

Method SyntaxNodeOrToken

SyntaxNodeOrToken(in SourceReference)

Gets the Roslyn SyntaxNodeOrToken from a SourceReference.

Declaration
public static SyntaxNodeOrToken SyntaxNodeOrToken(this in SourceReference sourceReference)
Parameters
Type Name Description
SourceReference sourceReference

The source reference.

Returns
Type Description
SyntaxNodeOrToken

The corresponding syntax node or token.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when the source reference contains neither a node nor a token.