Share via


IDocumentService.InitializeDocumentAsync Method

Definition

Ensures that a document snapshot is initialized and returns the latest snapshot. A document snapshot may be uninitialized if it is being lazy loaded such as documents in tabs that have not been made visible yet.

public System.Threading.Tasks.Task<Microsoft.VisualStudio.RpcContracts.Documents.DocumentSnapshot?> InitializeDocumentAsync (Microsoft.VisualStudio.RpcContracts.Documents.DocumentSnapshot documentSnapshot, System.Threading.CancellationToken token);
abstract member InitializeDocumentAsync : Microsoft.VisualStudio.RpcContracts.Documents.DocumentSnapshot * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.RpcContracts.Documents.DocumentSnapshot>
Public Function InitializeDocumentAsync (documentSnapshot As DocumentSnapshot, token As CancellationToken) As Task(Of DocumentSnapshot)

Parameters

documentSnapshot
DocumentSnapshot

Document snapshot to initialize.

token
CancellationToken

Cancellation token to monitor.

Returns

a DocumentSnapshot that represents the initialized document or null if document snapshot is no longer valid.

Applies to