diff --git a/src/Features/Core/Portable/AddImport/SymbolReferenceFinder.cs b/src/Features/Core/Portable/AddImport/SymbolReferenceFinder.cs index 411fd825fac0d60281ff8a333291683368b1a848..6192ee29a68834d2efa0a1c60a9b38bed15c9757 100644 --- a/src/Features/Core/Portable/AddImport/SymbolReferenceFinder.cs +++ b/src/Features/Core/Portable/AddImport/SymbolReferenceFinder.cs @@ -308,7 +308,7 @@ private bool HasAccessibleStaticFieldOrProperty(INamedTypeSymbol namedType, stri private async Task> GetReferencesForMatchingExtensionMethodsAsync(SearchScope searchScope) { searchScope.CancellationToken.ThrowIfCancellationRequested(); - if (!_owner.CanAddImportForMethod(_diagnostic, _syntaxFacts, _node, out var nameNode) && + if (_owner.CanAddImportForMethod(_diagnostic, _syntaxFacts, _node, out var nameNode) && nameNode != null) { searchScope.CancellationToken.ThrowIfCancellationRequested();