提交 d01a46e7 编写于 作者: C CyrusNajmabadi

Fix presentation.

上级 243ee2e5
...@@ -61,27 +61,25 @@ internal static class IStreamingFindUsagesPresenterExtensions ...@@ -61,27 +61,25 @@ internal static class IStreamingFindUsagesPresenterExtensions
return nonExternalItems[0].TryNavigateTo(); return nonExternalItems[0].TryNavigateTo();
} }
if (presenter == null) if (presenter != null)
{ {
// Don't have any way to present these items. // We have multiple definitions, or we have definitions with multiple locations.
return false; // 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. var context = presenter.StartSearch(title);
// Present this to the user so they can decide where they want to go to. foreach (var definition in nonExternalItems)
{
await context.OnDefinitionFoundAsync(definition).ConfigureAwait(false);
}
var context = presenter.StartSearch(title); // Note: we don't need to put this in a finally. The only time we might not hit
foreach (var definition in nonExternalItems) // 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
await context.OnDefinitionFoundAsync(definition).ConfigureAwait(false); // 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; return true;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册