示例#1
0
            /// <summary>
            /// Searches for extension methods exactly called 'Select'.  Returns
            /// <see cref="SymbolReference"/>s to the <see cref="INamespaceSymbol"/>s that contain
            /// the static classes that those extension methods are contained in.
            /// </summary>
            private async Task <ImmutableArray <SymbolReference> > GetReferencesForQueryPatternsAsync(SearchScope searchScope)
            {
                searchScope.CancellationToken.ThrowIfCancellationRequested();

                if (_owner.CanAddImportForQuery(_diagnosticId, _node))
                {
                    var type = _owner.GetQueryClauseInfo(_semanticModel, _node, searchScope.CancellationToken);
                    if (type != null)
                    {
                        // find extension methods named "Select"
                        return(await GetReferencesForExtensionMethodAsync(
                                   searchScope, nameof(Enumerable.Select), type).ConfigureAwait(false));
                    }
                }

                return(ImmutableArray <SymbolReference> .Empty);
            }