private static async Task FindSymbolReferencesAsync( IFindUsagesContext context, Document document, int position, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); // If this is a symbol from a metadata-as-source project, then map that symbol back to a symbol in the primary workspace. var symbolAndProjectOpt = await FindUsagesHelpers.GetRelevantSymbolAndProjectAtPositionAsync( document, position, cancellationToken).ConfigureAwait(false); if (symbolAndProjectOpt == null) { return; } var(symbol, project) = symbolAndProjectOpt.Value; await FindSymbolReferencesAsync( context, symbol, project, cancellationToken).ConfigureAwait(false); }
public async Task FindImplementationsAsync( IFindUsagesContext context, Document document, int position, CancellationToken cancellationToken) { // If this is a symbol from a metadata-as-source project, then map that symbol back to a symbol in the primary workspace. var symbolAndProjectOpt = await FindUsagesHelpers.GetRelevantSymbolAndProjectAtPositionAsync( document, position, cancellationToken).ConfigureAwait(false); if (symbolAndProjectOpt == null) { await context.ReportMessageAsync( FeaturesResources.Cannot_navigate_to_the_symbol_under_the_caret, cancellationToken).ConfigureAwait(false); return; } var symbolAndProject = symbolAndProjectOpt.Value; await FindImplementationsAsync( context, symbolAndProject.symbol, symbolAndProject.project, cancellationToken).ConfigureAwait(false); }