Skip to main content

SyntaxExtensions.LastIndexOf Method

Containing Type: SyntaxExtensions

Assembly: Roslynator.CSharp.dll

Overloads​

MethodSummary
LastIndexOf(SyntaxTriviaList, SyntaxKind)Searches for a trivia of the specified kind and returns the zero-based index of the last occurrence within the entire SyntaxTriviaList.
LastIndexOf<TNode>(SeparatedSyntaxList<TNode>, SyntaxKind)Searches for a node of the specified kind and returns the zero-based index of the last occurrence within the entire SeparatedSyntaxList<TNode>.
LastIndexOf<TNode>(SyntaxList<TNode>, SyntaxKind)Searches for a node of the specified kind and returns the zero-based index of the last occurrence within the entire SyntaxList<TNode>.

LastIndexOf(SyntaxTriviaList, SyntaxKind)​

Searches for a trivia of the specified kind and returns the zero-based index of the last occurrence within the entire SyntaxTriviaList.

public static int LastIndexOf(this Microsoft.CodeAnalysis.SyntaxTriviaList triviaList, Microsoft.CodeAnalysis.CSharp.SyntaxKind kind)

Parameters​

triviaList   SyntaxTriviaList

kind   SyntaxKind

Returns​

Int32

LastIndexOf<TNode>(SeparatedSyntaxList<TNode>, SyntaxKind)​

Searches for a node of the specified kind and returns the zero-based index of the last occurrence within the entire SeparatedSyntaxList<TNode>.

public static int LastIndexOf<TNode>(this Microsoft.CodeAnalysis.SeparatedSyntaxList<TNode> list, Microsoft.CodeAnalysis.CSharp.SyntaxKind kind) where TNode : Microsoft.CodeAnalysis.SyntaxNode

Type Parameters​

TNode

Parameters​

list   SeparatedSyntaxList<TNode>

kind   SyntaxKind

Returns​

Int32

LastIndexOf<TNode>(SyntaxList<TNode>, SyntaxKind)​

Searches for a node of the specified kind and returns the zero-based index of the last occurrence within the entire SyntaxList<TNode>.

public static int LastIndexOf<TNode>(this Microsoft.CodeAnalysis.SyntaxList<TNode> list, Microsoft.CodeAnalysis.CSharp.SyntaxKind kind) where TNode : Microsoft.CodeAnalysis.SyntaxNode

Type Parameters​

TNode

Parameters​

list   SyntaxList<TNode>

kind   SyntaxKind

Returns​

Int32