SyntaxNode.CopyAnnotationsTo<T>(T) 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.
Copies all SyntaxAnnotations, if any, from this SyntaxNode instance and attaches them to a new instance based on node
.
public:
generic <typename T>
where T : Microsoft::CodeAnalysis::SyntaxNode T CopyAnnotationsTo(T node);
public T CopyAnnotationsTo<T> (T node) where T : Microsoft.CodeAnalysis.SyntaxNode;
public T? CopyAnnotationsTo<T> (T? node) where T : Microsoft.CodeAnalysis.SyntaxNode;
member this.CopyAnnotationsTo : 'T -> 'T (requires 'T :> Microsoft.CodeAnalysis.SyntaxNode)
Public Function CopyAnnotationsTo(Of T As SyntaxNode) (node As T) As T
Type Parameters
- T
Parameters
- node
- T
Returns
T
Remarks
If no annotations are copied, just returns node
.
It can also be used manually to preserve annotations in a more complex tree modification, even if the type of a node changes.
Applies to
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET