From d01a46e7ee6dbfa7ab7d6cd26c045a560e540361 Mon Sep 17 00:00:00 2001 From: CyrusNajmabadi Date: Sat, 19 Nov 2016 20:56:45 -0800 Subject: [PATCH] Fix presentation. --- .../Host/IStreamingFindReferencesPresenter.cs | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/EditorFeatures/Core/Host/IStreamingFindReferencesPresenter.cs b/src/EditorFeatures/Core/Host/IStreamingFindReferencesPresenter.cs index 1196400363f..727f4526267 100644 --- a/src/EditorFeatures/Core/Host/IStreamingFindReferencesPresenter.cs +++ b/src/EditorFeatures/Core/Host/IStreamingFindReferencesPresenter.cs @@ -61,27 +61,25 @@ internal static class IStreamingFindUsagesPresenterExtensions return nonExternalItems[0].TryNavigateTo(); } - if (presenter == null) + if (presenter != null) { - // Don't have any way to present these items. - return false; - } + // We have multiple definitions, or we have definitions with multiple locations. + // Present this to the user so they can decide where they want to go to. - // We have multiple definitions, or we have definitions with multiple locations. - // Present this to the user so they can decide where they want to go to. + var context = presenter.StartSearch(title); + foreach (var definition in nonExternalItems) + { + await context.OnDefinitionFoundAsync(definition).ConfigureAwait(false); + } - var context = presenter.StartSearch(title); - foreach (var definition in nonExternalItems) - { - await context.OnDefinitionFoundAsync(definition).ConfigureAwait(false); + // Note: we don't need to put this in a finally. The only time we might not hit + // this is if cancellation or another error gets thrown. In the former case, + // that means that a new search has started. We don't care about telling the + // context it has completed. In the latter case somethign wrong has happened + // and we don't want to run any more code code in this particular context. + await context.OnCompletedAsync().ConfigureAwait(false); } - // Note: we don't need to put this in a finally. The only time we might not hit - // this is if cancellation or another error gets thrown. In the former case, - // that means that a new search has started. We don't care about telling the - // context it has completed. In the latter case somethign wrong has happened - // and we don't want to run any more code code in this particular context. - await context.OnCompletedAsync().ConfigureAwait(false); return true; } } -- GitLab