Partager via


IEditorHostService.CreateTextDocumentAsync Method

Definition

Creates a new ITextDocumentSnapshot from a serializable TextDocumentContract RPC contract.

public System.Threading.Tasks.Task<Microsoft.VisualStudio.Extensibility.Editor.ITextDocumentSnapshot> CreateTextDocumentAsync (Microsoft.VisualStudio.RpcContracts.Editor.TextDocumentContract textDocument, System.Threading.CancellationToken cancellationToken);
abstract member CreateTextDocumentAsync : Microsoft.VisualStudio.RpcContracts.Editor.TextDocumentContract * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Extensibility.Editor.ITextDocumentSnapshot>
Public Function CreateTextDocumentAsync (textDocument As TextDocumentContract, cancellationToken As CancellationToken) As Task(Of ITextDocumentSnapshot)

Parameters

textDocument
TextDocumentContract

A serializable TextDocumentContract RPC contract.

cancellationToken
CancellationToken

Cancels the request.

Returns

An ITextDocumentSnapshot thick object that can be used to interact with the document.

Applies to