Skip to content

GenericSymbolWithSyntax.FromSyntaxNode

Michael Rittenhouse edited this page Feb 12, 2024 · 5 revisions

GenericSymbolWithSyntax.FromSyntaxNode(SyntaxNode, SemanticModel, CancellationToken) Method

Definition

Gets a new instance representing the given syntax node and its associated generic symbol.

public static GenericSymbolWithSyntax? FromSyntaxNode(SyntaxNode syntaxNode, SemanticModel semanticModel, CancellationToken cancellationToken)

Parameters

syntaxNode SyntaxNode
The syntax node to associate with a generic symbol

semanticModel SemanticModel
The SemanticModel used to get a symbolic reference to syntaxNode.

cancellationToken CancellationToken
The CancellationToken that will be observed while retrieving symbolic info from the semanticModel.

Returns

GenericSymbolWithSyntax?

null, if semanticModel does not resolve syntaxNode to a generic symbol or the symbol is the original symbol definition; otherwise, the new instance.

Clone this wiki locally