Udostępnij za pośrednictwem


SemanticModel.GetDeclaredSymbolsCore(SyntaxNode, CancellationToken) Method

Definition

Gets the symbols associated with a declaration syntax node. Unlike Microsoft.CodeAnalysis.SemanticModel.GetDeclaredSymbolForNode(Microsoft.CodeAnalysis.SyntaxNode,System.Threading.CancellationToken), this method returns all symbols declared by a given declaration syntax node. Specifically:

protected abstract System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISymbol> GetDeclaredSymbolsCore (Microsoft.CodeAnalysis.SyntaxNode declaration, System.Threading.CancellationToken cancellationToken = default);
abstract member GetDeclaredSymbolsCore : Microsoft.CodeAnalysis.SyntaxNode * System.Threading.CancellationToken -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISymbol>
Protected MustOverride Function GetDeclaredSymbolsCore (declaration As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol)

Parameters

declaration
SyntaxNode

A syntax node that is a declaration. This can be any type derived from MemberDeclarationSyntax, TypeDeclarationSyntax, EnumDeclarationSyntax, NamespaceDeclarationSyntax, ParameterSyntax, TypeParameterSyntax, or the alias part of a UsingDirectiveSyntax

cancellationToken
CancellationToken

The cancellation token.

Returns

The symbols declared by the node.

Applies to