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에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET