ISymbol.DeclaringSyntaxReferences Property

Definition

Get the syntax node(s) where this symbol was declared in source. Some symbols (for example, partial classes) may be defined in more than one location. This property should return one or more syntax nodes only if the symbol was declared in source code and also was not implicitly declared (see the IsImplicitlyDeclared property).

Note that for namespace symbol, the declaring syntax might be declaring a nested namespace. For example, the declaring syntax node for N1 in "namespace N1.N2 {...}" is the entire NamespaceDeclarationSyntax for N1.N2. For the global namespace, the declaring syntax will be the CompilationUnitSyntax.

public:
 property System::Collections::Immutable::ImmutableArray<Microsoft::CodeAnalysis::SyntaxReference ^> DeclaringSyntaxReferences { System::Collections::Immutable::ImmutableArray<Microsoft::CodeAnalysis::SyntaxReference ^> get(); };
public System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.SyntaxReference> DeclaringSyntaxReferences { get; }
member this.DeclaringSyntaxReferences : System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.SyntaxReference>
Public ReadOnly Property DeclaringSyntaxReferences As ImmutableArray(Of SyntaxReference)

Property Value

The syntax node(s) that declared the symbol. If the symbol was declared in metadata or was implicitly declared, returns an empty read-only array.

Applies to