Open sandboxFocus

Method TryGetDeclaration

TryGetDeclaration(ICompilation, ISymbol, out IDeclaration?)

Attempts to get the Metalama IDeclaration for a Roslyn ISymbol.

Declaration
public static bool TryGetDeclaration(this ICompilation compilation, ISymbol symbol, out IDeclaration? declaration)
Parameters
Type Name Description
ICompilation compilation

The Metalama compilation.

ISymbol symbol

The Roslyn symbol.

IDeclaration declaration

When successful, the Metalama declaration.

Returns
Type Description
bool

true if the symbol was found in the compilation; otherwise false.