Skip to main content

SyntaxExtensions.ReplaceAt Method

Containing Type: SyntaxExtensions

Assembly: Roslynator.Core.dll

Overloads​

MethodSummary
ReplaceAt(SyntaxTokenList, Int32, SyntaxToken)Creates a new SyntaxTokenList with a token at the specified index replaced with a new token.
ReplaceAt(SyntaxTriviaList, Int32, SyntaxTrivia)Creates a new SyntaxTriviaList with a trivia at the specified index replaced with new trivia.
ReplaceAt<TNode>(SeparatedSyntaxList<TNode>, Int32, TNode)Creates a new list with a node at the specified index replaced with a new node.
ReplaceAt<TNode>(SyntaxList<TNode>, Int32, TNode)Creates a new list with the node at the specified index replaced with a new node.

ReplaceAt(SyntaxTokenList, Int32, SyntaxToken)​

Creates a new SyntaxTokenList with a token at the specified index replaced with a new token.

public static Microsoft.CodeAnalysis.SyntaxTokenList ReplaceAt(this Microsoft.CodeAnalysis.SyntaxTokenList tokenList, int index, Microsoft.CodeAnalysis.SyntaxToken newToken)

Parameters​

tokenList   SyntaxTokenList

index   Int32

newToken   SyntaxToken

Returns​

SyntaxTokenList

ReplaceAt(SyntaxTriviaList, Int32, SyntaxTrivia)​

Creates a new SyntaxTriviaList with a trivia at the specified index replaced with new trivia.

public static Microsoft.CodeAnalysis.SyntaxTriviaList ReplaceAt(this Microsoft.CodeAnalysis.SyntaxTriviaList triviaList, int index, Microsoft.CodeAnalysis.SyntaxTrivia newTrivia)

Parameters​

triviaList   SyntaxTriviaList

index   Int32

newTrivia   SyntaxTrivia

Returns​

SyntaxTriviaList

ReplaceAt<TNode>(SeparatedSyntaxList<TNode>, Int32, TNode)​

Creates a new list with a node at the specified index replaced with a new node.

public static Microsoft.CodeAnalysis.SeparatedSyntaxList<TNode> ReplaceAt<TNode>(this Microsoft.CodeAnalysis.SeparatedSyntaxList<TNode> list, int index, TNode newNode) where TNode : Microsoft.CodeAnalysis.SyntaxNode

Type Parameters​

TNode

Parameters​

list   SeparatedSyntaxList<TNode>

index   Int32

newNode   TNode

Returns​

SeparatedSyntaxList<TNode>

ReplaceAt<TNode>(SyntaxList<TNode>, Int32, TNode)​

Creates a new list with the node at the specified index replaced with a new node.

public static Microsoft.CodeAnalysis.SyntaxList<TNode> ReplaceAt<TNode>(this Microsoft.CodeAnalysis.SyntaxList<TNode> list, int index, TNode newNode) where TNode : Microsoft.CodeAnalysis.SyntaxNode

Type Parameters​

TNode

Parameters​

list   SyntaxList<TNode>

index   Int32

newNode   TNode

Returns​

SyntaxList<TNode>