Share via


SymbolFinder.FindSimilarSymbols<TSymbol> Method

Definition

Finds symbols in the given compilation that are similar to the specified symbol.

A found symbol may be the exact same symbol instance if the compilation is the origin of the specified symbol, or it may be a different symbol instance if the compilation is not the originating compilation.

Multiple symbols may be returned if there are ambiguous matches. No symbols may be returned if the compilation does not define or have access to a similar symbol.

public static System.Collections.Generic.IEnumerable<TSymbol> FindSimilarSymbols<TSymbol> (TSymbol symbol, Microsoft.CodeAnalysis.Compilation compilation, System.Threading.CancellationToken cancellationToken = default) where TSymbol : Microsoft.CodeAnalysis.ISymbol;
static member FindSimilarSymbols : 'Symbol * Microsoft.CodeAnalysis.Compilation * System.Threading.CancellationToken -> seq<'Symbol (requires 'Symbol :> Microsoft.CodeAnalysis.ISymbol)> (requires 'Symbol :> Microsoft.CodeAnalysis.ISymbol)
Public Shared Function FindSimilarSymbols(Of TSymbol As ISymbol) (symbol As TSymbol, compilation As Compilation, Optional cancellationToken As CancellationToken = Nothing) As IEnumerable(Of TSymbol)

Type Parameters

TSymbol

Parameters

symbol
TSymbol

The symbol to find corresponding matches for.

compilation
Compilation

A compilation to find the corresponding symbol within. The compilation may or may not be the origin of the symbol.

cancellationToken
CancellationToken

A CancellationToken.

Returns

IEnumerable<TSymbol>

Applies to