Skip to main content

SyntaxExtensions.WithTriviaFrom Method

Containing Type: SyntaxExtensions

Assembly: Roslynator.Core.dll

Overloads​

MethodSummary
WithTriviaFrom(SyntaxToken, SyntaxNode)Creates a new token from this token with both the leading and trailing trivia of the specified node.
WithTriviaFrom<TNode>(SeparatedSyntaxList<TNode>, SyntaxNode)Creates a new separated list with both leading and trailing trivia of the specified node. If the list contains more than one item, first item is updated with leading trivia and last item is updated with trailing trivia.
WithTriviaFrom<TNode>(SyntaxList<TNode>, SyntaxNode)Creates a new list with both leading and trailing trivia of the specified node. If the list contains more than one item, first item is updated with leading trivia and last item is updated with trailing trivia.
WithTriviaFrom<TNode>(TNode, SyntaxToken)Creates a new node from this node with both the leading and trailing trivia of the specified token.

WithTriviaFrom(SyntaxToken, SyntaxNode)​

Creates a new token from this token with both the leading and trailing trivia of the specified node.

public static Microsoft.CodeAnalysis.SyntaxToken WithTriviaFrom(this Microsoft.CodeAnalysis.SyntaxToken token, Microsoft.CodeAnalysis.SyntaxNode node)

Parameters​

token   SyntaxToken

node   SyntaxNode

Returns​

SyntaxToken

WithTriviaFrom<TNode>(SeparatedSyntaxList<TNode>, SyntaxNode)​

Creates a new separated list with both leading and trailing trivia of the specified node. If the list contains more than one item, first item is updated with leading trivia and last item is updated with trailing trivia.

public static Microsoft.CodeAnalysis.SeparatedSyntaxList<TNode> WithTriviaFrom<TNode>(this Microsoft.CodeAnalysis.SeparatedSyntaxList<TNode> list, Microsoft.CodeAnalysis.SyntaxNode node) where TNode : Microsoft.CodeAnalysis.SyntaxNode

Type Parameters​

TNode

Parameters​

list   SeparatedSyntaxList<TNode>

node   SyntaxNode

Returns​

SeparatedSyntaxList<TNode>

WithTriviaFrom<TNode>(SyntaxList<TNode>, SyntaxNode)​

Creates a new list with both leading and trailing trivia of the specified node. If the list contains more than one item, first item is updated with leading trivia and last item is updated with trailing trivia.

public static Microsoft.CodeAnalysis.SyntaxList<TNode> WithTriviaFrom<TNode>(this Microsoft.CodeAnalysis.SyntaxList<TNode> list, Microsoft.CodeAnalysis.SyntaxNode node) where TNode : Microsoft.CodeAnalysis.SyntaxNode

Type Parameters​

TNode

Parameters​

list   SyntaxList<TNode>

node   SyntaxNode

Returns​

SyntaxList<TNode>

WithTriviaFrom<TNode>(TNode, SyntaxToken)​

Creates a new node from this node with both the leading and trailing trivia of the specified token.

public static TNode WithTriviaFrom<TNode>(this TNode node, Microsoft.CodeAnalysis.SyntaxToken token) where TNode : Microsoft.CodeAnalysis.SyntaxNode

Type Parameters​

TNode

Parameters​

node   TNode

token   SyntaxToken

Returns​

TNode