From 80e77a3cd2c860fbe1559f4cbc12d44cd613aa69 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Wed, 8 Feb 2023 15:36:19 -0600 Subject: [PATCH] Merge pull request #66758 from sharwell/far-loop Avoid searching for any empty identifier in Find All References --- .../FindReferences/Finders/AbstractReferenceFinder.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractReferenceFinder.cs b/src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractReferenceFinder.cs index 3f0e01c2635d1..8713c8134c529 100644 --- a/src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractReferenceFinder.cs +++ b/src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractReferenceFinder.cs @@ -160,11 +160,12 @@ protected static bool IdentifiersMatch(ISyntaxFactsService syntaxFacts, string n FindReferencesDocumentState state, CancellationToken cancellationToken) { - if (symbol.IsAnonymousType()) + if (identifier == "") { - // Anonymous types don't have a name, so we return without further searching since the text-based index + // Certain symbols don't have a name, so we return without further searching since the text-based index // and lookup never terminates if searching for an empty string. // https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1655431 + // https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1744118 return ImmutableArray.Empty; }