public static async Task <bool> TryNavigateToAsync( this INavigableLocation?location, IThreadingContext threadingContext, NavigationOptions options, CancellationToken cancellationToken) { if (location == null) { return(false); } // This switch is currently unnecessary. Howevver, it helps support a future where location.NavigateTo becomes // async and must be on the UI thread. await threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); return(await location.NavigateToAsync(options, cancellationToken).ConfigureAwait(false)); }
/// <remarks>Legal to call from any thread.</remarks> public static Task <bool> TryNavigateToSpanAsync(this IDocumentNavigationService service, Workspace workspace, DocumentId documentId, TextSpan textSpan, NavigationOptions options, CancellationToken cancellationToken) => service.TryNavigateToSpanAsync(workspace, documentId, textSpan, options, allowInvalidSpan: false, cancellationToken);
public bool TryNavigateToSymbol(ISymbol symbol, Project project, NavigationOptions options, CancellationToken cancellationToken) => false;
public Task <bool> TryNavigateToSymbolAsync(ISymbol symbol, Project project, NavigationOptions options, CancellationToken cancellationToken) => SpecializedTasks.False;
public Task <bool> TryNavigateToPositionAsync(Workspace workspace, DocumentId documentId, int position, int virtualSpace, NavigationOptions options, CancellationToken cancellationToken) => SpecializedTasks.False;
public Task <bool> TryNavigateToLineAndOffsetAsync(Workspace workspace, DocumentId documentId, int lineNumber, int offset, NavigationOptions options, CancellationToken cancellationToken) => SpecializedTasks.False;
public Task <bool> TryNavigateToSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, NavigationOptions options, bool allowInvalidSpan, CancellationToken cancellationToken) => SpecializedTasks.False;
public static async Task <bool> TryNavigateToLineAndOffsetAsync( this IDocumentNavigationService service, IThreadingContext threadingContext, Workspace workspace, DocumentId documentId, int lineNumber, int offset, NavigationOptions options, CancellationToken cancellationToken) { var location = await service.GetLocationForLineAndOffsetAsync( workspace, documentId, lineNumber, offset, cancellationToken).ConfigureAwait(false); return(await location.TryNavigateToAsync(threadingContext, options, cancellationToken).ConfigureAwait(false)); }
public static async Task <bool> TryNavigateToPositionAsync( this IDocumentNavigationService service, IThreadingContext threadingContext, Workspace workspace, DocumentId documentId, int position, int virtualSpace, NavigationOptions options, CancellationToken cancellationToken) { var location = await service.GetLocationForPositionAsync(workspace, documentId, position, virtualSpace, cancellationToken).ConfigureAwait(false); return(await location.TryNavigateToAsync(threadingContext, options, cancellationToken).ConfigureAwait(false)); }
public static async Task <bool> TryNavigateToSpanAsync( this IDocumentNavigationService service, IThreadingContext threadingContext, Workspace workspace, DocumentId documentId, TextSpan textSpan, NavigationOptions options, bool allowInvalidSpan, CancellationToken cancellationToken) { var location = await service.GetLocationForSpanAsync(workspace, documentId, textSpan, allowInvalidSpan, cancellationToken).ConfigureAwait(false); return(await location.TryNavigateToAsync(threadingContext, options, cancellationToken).ConfigureAwait(false)); }
public bool TryNavigateToPosition(Workspace workspace, DocumentId documentId, int position, int virtualSpace, NavigationOptions options, CancellationToken cancellationToken) => false;
public bool TryNavigateToLineAndOffset(Workspace workspace, DocumentId documentId, int lineNumber, int offset, NavigationOptions options, CancellationToken cancellationToken) => false;
public bool TryNavigateToSpan(Workspace workspace, DocumentId documentId, TextSpan textSpan, NavigationOptions options, bool allowInvalidSpan, CancellationToken cancellationToken) => false;