Skip to main content

SyntaxExtensions.Contains Method

Containing Type: SyntaxExtensions

Assembly: Roslynator.CSharp.dll

Overloads

MethodSummary
Contains(SyntaxTokenList, SyntaxKind)Returns true if a token of the specified kind is in the SyntaxTokenList.
Contains(SyntaxTriviaList, SyntaxKind)Returns true if a trivia of the specified kind is in the SyntaxTriviaList.
Contains<TNode>(SeparatedSyntaxList<TNode>, SyntaxKind)Searches for a node of the specified kind and returns the zero-based index of the first occurrence within the entire SeparatedSyntaxList<TNode>.
Contains<TNode>(SyntaxList<TNode>, SyntaxKind)Returns true if a node of the specified kind is in the SyntaxList<TNode>.

Contains(SyntaxTokenList, SyntaxKind)

Returns true if a token of the specified kind is in the SyntaxTokenList.

public static bool Contains(this Microsoft.CodeAnalysis.SyntaxTokenList tokenList, Microsoft.CodeAnalysis.CSharp.SyntaxKind kind)

Parameters

tokenList SyntaxTokenList

kind SyntaxKind

Returns

Boolean

Contains(SyntaxTriviaList, SyntaxKind)

Returns true if a trivia of the specified kind is in the SyntaxTriviaList.

public static bool Contains(this Microsoft.CodeAnalysis.SyntaxTriviaList triviaList, Microsoft.CodeAnalysis.CSharp.SyntaxKind kind)

Parameters

triviaList SyntaxTriviaList

kind SyntaxKind

Returns

Boolean

Contains<TNode>(SeparatedSyntaxList<TNode>, SyntaxKind)

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

public static bool Contains<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

Boolean

Contains<TNode>(SyntaxList<TNode>, SyntaxKind)

Returns true if a node of the specified kind is in the SyntaxList<TNode>.

public static bool Contains<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

Boolean