Skip to main content

CSharpExtensions.GetSymbol Method

Containing Type: CSharpExtensions

Assembly: Roslynator.CSharp.dll

Overloads​

MethodSummary
GetSymbol(SemanticModel, AttributeSyntax, CancellationToken)Returns what symbol, if any, the specified attribute syntax bound to.
GetSymbol(SemanticModel, ConstructorInitializerSyntax, CancellationToken)Returns what symbol, if any, the specified constructor initializer syntax bound to.
GetSymbol(SemanticModel, CrefSyntax, CancellationToken)Returns what symbol, if any, the specified cref syntax bound to.
GetSymbol(SemanticModel, ExpressionSyntax, CancellationToken)Returns what symbol, if any, the specified expression syntax bound to.
GetSymbol(SemanticModel, OrderingSyntax, CancellationToken)Returns what symbol, if any, the specified ordering syntax bound to.
GetSymbol(SemanticModel, SelectOrGroupClauseSyntax, CancellationToken)Returns what symbol, if any, the specified select or group clause bound to.

GetSymbol(SemanticModel, AttributeSyntax, CancellationToken)​

Returns what symbol, if any, the specified attribute syntax bound to.

public static Microsoft.CodeAnalysis.ISymbol? GetSymbol(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntax attribute, System.Threading.CancellationToken cancellationToken = default)

Parameters​

semanticModel   SemanticModel

attribute   AttributeSyntax

cancellationToken   CancellationToken

Returns​

ISymbol

GetSymbol(SemanticModel, ConstructorInitializerSyntax, CancellationToken)​

Returns what symbol, if any, the specified constructor initializer syntax bound to.

public static Microsoft.CodeAnalysis.ISymbol? GetSymbol(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorInitializerSyntax constructorInitializer, System.Threading.CancellationToken cancellationToken = default)

Parameters​

semanticModel   SemanticModel

constructorInitializer   ConstructorInitializerSyntax

cancellationToken   CancellationToken

Returns​

ISymbol

GetSymbol(SemanticModel, CrefSyntax, CancellationToken)​

Returns what symbol, if any, the specified cref syntax bound to.

public static Microsoft.CodeAnalysis.ISymbol? GetSymbol(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.CrefSyntax cref, System.Threading.CancellationToken cancellationToken = default)

Parameters​

semanticModel   SemanticModel

cref   CrefSyntax

cancellationToken   CancellationToken

Returns​

ISymbol

GetSymbol(SemanticModel, ExpressionSyntax, CancellationToken)​

Returns what symbol, if any, the specified expression syntax bound to.

public static Microsoft.CodeAnalysis.ISymbol? GetSymbol(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, System.Threading.CancellationToken cancellationToken = default)

Parameters​

semanticModel   SemanticModel

expression   ExpressionSyntax

cancellationToken   CancellationToken

Returns​

ISymbol

GetSymbol(SemanticModel, OrderingSyntax, CancellationToken)​

Returns what symbol, if any, the specified ordering syntax bound to.

public static Microsoft.CodeAnalysis.ISymbol? GetSymbol(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.OrderingSyntax ordering, System.Threading.CancellationToken cancellationToken = default)

Parameters​

semanticModel   SemanticModel

ordering   OrderingSyntax

cancellationToken   CancellationToken

Returns​

ISymbol

GetSymbol(SemanticModel, SelectOrGroupClauseSyntax, CancellationToken)​

Returns what symbol, if any, the specified select or group clause bound to.

public static Microsoft.CodeAnalysis.ISymbol? GetSymbol(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.SelectOrGroupClauseSyntax selectOrGroupClause, System.Threading.CancellationToken cancellationToken = default)

Parameters​

semanticModel   SemanticModel

selectOrGroupClause   SelectOrGroupClauseSyntax

cancellationToken   CancellationToken

Returns​

ISymbol