SyntaxNodeExtensions.ReplaceToken Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ReplaceToken<TRoot>(TRoot, SyntaxToken, IEnumerable<SyntaxToken>) |
Creates a new tree of nodes with the specified old token replaced with new tokens. |
ReplaceToken<TRoot>(TRoot, SyntaxToken, SyntaxToken) |
Creates a new tree of nodes with the specified old token replaced with a new token. |
ReplaceToken<TRoot>(TRoot, SyntaxToken, IEnumerable<SyntaxToken>)
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
Creates a new tree of nodes with the specified old token replaced with new tokens.
public:
generic <typename TRoot>
where TRoot : Microsoft::CodeAnalysis::SyntaxNode[System::Runtime::CompilerServices::Extension]
static TRoot ReplaceToken(TRoot root, Microsoft::CodeAnalysis::SyntaxToken tokenInList, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::SyntaxToken> ^ newTokens);
public static TRoot ReplaceToken<TRoot> (this TRoot root, Microsoft.CodeAnalysis.SyntaxToken tokenInList, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> newTokens) where TRoot : Microsoft.CodeAnalysis.SyntaxNode;
static member ReplaceToken : 'Root * Microsoft.CodeAnalysis.SyntaxToken * seq<Microsoft.CodeAnalysis.SyntaxToken> -> 'Root (requires 'Root :> Microsoft.CodeAnalysis.SyntaxNode)
<Extension()>
Public Function ReplaceToken(Of TRoot As SyntaxNode) (root As TRoot, tokenInList As SyntaxToken, newTokens As IEnumerable(Of SyntaxToken)) As TRoot
Type Parameters
- TRoot
The type of the root node.
Parameters
- root
- TRoot
The root of the tree of nodes.
- tokenInList
- SyntaxToken
The token to be replaced; a descendant of the root node and an element of a list member.
- newTokens
- IEnumerable<SyntaxToken>
A sequence of tokens to use in the tree in place of the specified token.
Returns
Applies to
ReplaceToken<TRoot>(TRoot, SyntaxToken, SyntaxToken)
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
- Source:
- SyntaxNodeExtensions.cs
Creates a new tree of nodes with the specified old token replaced with a new token.
public:
generic <typename TRoot>
where TRoot : Microsoft::CodeAnalysis::SyntaxNode[System::Runtime::CompilerServices::Extension]
static TRoot ReplaceToken(TRoot root, Microsoft::CodeAnalysis::SyntaxToken oldToken, Microsoft::CodeAnalysis::SyntaxToken newToken);
public static TRoot ReplaceToken<TRoot> (this TRoot root, Microsoft.CodeAnalysis.SyntaxToken oldToken, Microsoft.CodeAnalysis.SyntaxToken newToken) where TRoot : Microsoft.CodeAnalysis.SyntaxNode;
static member ReplaceToken : 'Root * Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.SyntaxToken -> 'Root (requires 'Root :> Microsoft.CodeAnalysis.SyntaxNode)
<Extension()>
Public Function ReplaceToken(Of TRoot As SyntaxNode) (root As TRoot, oldToken As SyntaxToken, newToken As SyntaxToken) As TRoot
Type Parameters
- TRoot
The type of the root node.
Parameters
- root
- TRoot
The root node of the tree of nodes.
- oldToken
- SyntaxToken
The token to be replaced.
- newToken
- SyntaxToken
The new token to use in the new tree in place of the old token.