Compartilhar via


DocumentExtensions.AsTextDocumentAsync Method

Definition

Gets a ITextDocumentSnapshot from an open document snapshot.

public static System.Threading.Tasks.Task<Microsoft.VisualStudio.Extensibility.Editor.ITextDocumentSnapshot?> AsTextDocumentAsync (this Microsoft.VisualStudio.RpcContracts.Documents.DocumentSnapshot documentSnapshot, Microsoft.VisualStudio.Extensibility.VisualStudioExtensibility extensibility, System.Threading.CancellationToken cancellationToken);
static member AsTextDocumentAsync : Microsoft.VisualStudio.RpcContracts.Documents.DocumentSnapshot * Microsoft.VisualStudio.Extensibility.VisualStudioExtensibility * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Extensibility.Editor.ITextDocumentSnapshot>
<Extension()>
Public Function AsTextDocumentAsync (documentSnapshot As DocumentSnapshot, extensibility As VisualStudioExtensibility, cancellationToken As CancellationToken) As Task(Of ITextDocumentSnapshot)

Parameters

documentSnapshot
DocumentSnapshot

The document snapshot to operate on.

extensibility
VisualStudioExtensibility

Extensibility object.

cancellationToken
CancellationToken

The cancellation token.

Returns

A text document snapshot matching the version of the document snapshot.

Applies to