LocationExtensions Class

internal static class LocationExtensions

No documentation is available.

Methods

NameDescription
GetEndLine(SyntaxNode, CancellationToken)Gets the end line of the given node.
GetEndLine(SyntaxToken, CancellationToken)Gets the end line of the given token.
GetEndLine(SyntaxTrivia, CancellationToken)Gets the end line of the given trivia.
GetLine(SyntaxNode, CancellationToken)Gets the line on which the given node occurs.
GetLine(SyntaxToken, CancellationToken)Gets the line on which the given token occurs.
GetLine(SyntaxTrivia, CancellationToken)Gets the line on which the given trivia occurs.
GetLineSpan(SyntaxNode, CancellationToken)Gets the location in terms of path, line and column for a given node.
GetLineSpan(SyntaxNodeOrToken, CancellationToken)Gets the location in terms of path, line and column for a given node or token.
GetLineSpan(SyntaxToken, CancellationToken)Gets the location in terms of path, line and column for a given token.
GetLineSpan(SyntaxTrivia, CancellationToken)Gets the location in terms of path, line and column for a given trivia.
SpansMultipleLines(SyntaxNode, CancellationToken)Get a value indicating whether the given node span multiple source text lines.
SpansMultipleLines(SyntaxTrivia, CancellationToken)Gets a value indicating whether the given trivia span multiple source text lines.

GetEndLine overloads

GetEndLine(SyntaxNode, CancellationToken)

Gets the end line of the given node.

internal static int? GetEndLine(this SyntaxNode node, CancellationToken cancellationToken)
Parameters
node SyntaxNode
The node to use.
cancellationToken CancellationToken
Returns

int? The line on which the given node ends.

GetEndLine(SyntaxToken, CancellationToken)

Gets the end line of the given token.

internal static int? GetEndLine(this SyntaxToken token, CancellationToken cancellationToken)
Parameters
token SyntaxToken
The token to use.
cancellationToken CancellationToken
Returns

int? The line on which the given token ends.

GetEndLine(SyntaxTrivia, CancellationToken)

Gets the end line of the given trivia.

internal static int? GetEndLine(this SyntaxTrivia trivia, CancellationToken cancellationToken)
Parameters
trivia SyntaxTrivia
The trivia to use.
cancellationToken CancellationToken
Returns

int? The line on which the given trivia ends.

GetLine overloads

GetLine(SyntaxNode, CancellationToken)

Gets the line on which the given node occurs.

internal static int? GetLine(this SyntaxNode node, CancellationToken cancellationToken)
Parameters
node SyntaxNode
The node to use.
cancellationToken CancellationToken
Returns

int? The line on which the given node occurs.

GetLine(SyntaxToken, CancellationToken)

Gets the line on which the given token occurs.

internal static int? GetLine(this SyntaxToken token, CancellationToken cancellationToken)
Parameters
token SyntaxToken
The token to use.
cancellationToken CancellationToken
Returns

int? The line on which the given token occurs.

GetLine(SyntaxTrivia, CancellationToken)

Gets the line on which the given trivia occurs.

internal static int? GetLine(this SyntaxTrivia trivia, CancellationToken cancellationToken)
Parameters
trivia SyntaxTrivia
The trivia to use.
cancellationToken CancellationToken
Returns

int? The line on which the given trivia occurs.

GetLineSpan overloads

GetLineSpan(SyntaxNode, CancellationToken)

Gets the location in terms of path, line and column for a given node.

internal static FileLinePositionSpan? GetLineSpan(this SyntaxNode node, CancellationToken cancellationToken)
Parameters
node SyntaxNode
The node to use.
cancellationToken CancellationToken
Returns

FileLinePositionSpan? The location in terms of path, line and column for a given node.

GetLineSpan(SyntaxNodeOrToken, CancellationToken)

Gets the location in terms of path, line and column for a given node or token.

internal static FileLinePositionSpan? GetLineSpan(this SyntaxNodeOrToken nodeOrToken, CancellationToken cancellationToken)
Parameters
nodeOrToken SyntaxNodeOrToken
The trivia to use.
cancellationToken CancellationToken
Returns

FileLinePositionSpan? The location in terms of path, line and column for a given node or token.

GetLineSpan(SyntaxToken, CancellationToken)

Gets the location in terms of path, line and column for a given token.

internal static FileLinePositionSpan? GetLineSpan(this SyntaxToken token, CancellationToken cancellationToken)
Parameters
token SyntaxToken
The token to use.
cancellationToken CancellationToken
Returns

FileLinePositionSpan? The location in terms of path, line and column for a given token.

GetLineSpan(SyntaxTrivia, CancellationToken)

Gets the location in terms of path, line and column for a given trivia.

internal static FileLinePositionSpan? GetLineSpan(this SyntaxTrivia trivia, CancellationToken cancellationToken)
Parameters
trivia SyntaxTrivia
The trivia to use.
cancellationToken CancellationToken
Returns

FileLinePositionSpan? The location in terms of path, line and column for a given trivia.

SpansMultipleLines overloads

SpansMultipleLines(SyntaxNode, CancellationToken)

Get a value indicating whether the given node span multiple source text lines.

internal static bool SpansMultipleLines(this SyntaxNode node, CancellationToken cancellationToken)
Parameters
node SyntaxNode
The node to check.
cancellationToken CancellationToken
Returns

bool True, if the node spans multiple source text lines.

SpansMultipleLines(SyntaxTrivia, CancellationToken)

Gets a value indicating whether the given trivia span multiple source text lines.

internal static bool SpansMultipleLines(this SyntaxTrivia trivia, CancellationToken cancellationToken)
Parameters
trivia SyntaxTrivia
The trivia to check.
cancellationToken CancellationToken
Returns

bool true if the trivia spans multiple source text lines; otherwise, false.