Partilhar via


IAsyncCompletionSource.GetCompletionContextAsync Method

Definition

Overloads

GetCompletionContextAsync(InitialTrigger, SnapshotPoint, SnapshotSpan, CancellationToken)

Called once per completion session to fetch the set of all completion items available at a given location. Called on a background thread.

GetCompletionContextAsync(IAsyncCompletionSession, CompletionTrigger, SnapshotPoint, SnapshotSpan, CancellationToken)

Called once per completion session to fetch the set of all completion items available at a given location. Called on a background thread.

GetCompletionContextAsync(InitialTrigger, SnapshotPoint, SnapshotSpan, CancellationToken)

Called once per completion session to fetch the set of all completion items available at a given location. Called on a background thread.

public:
 System::Threading::Tasks::Task<Microsoft::VisualStudio::Language::Intellisense::AsyncCompletion::Data::CompletionContext ^> ^ GetCompletionContextAsync(Microsoft::VisualStudio::Language::Intellisense::AsyncCompletion::Data::InitialTrigger trigger, Microsoft::VisualStudio::Text::SnapshotPoint triggerLocation, Microsoft::VisualStudio::Text::SnapshotSpan applicableToSpan, System::Threading::CancellationToken token);
public System.Threading.Tasks.Task<Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.CompletionContext> GetCompletionContextAsync (Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.InitialTrigger trigger, Microsoft.VisualStudio.Text.SnapshotPoint triggerLocation, Microsoft.VisualStudio.Text.SnapshotSpan applicableToSpan, System.Threading.CancellationToken token);
abstract member GetCompletionContextAsync : Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.InitialTrigger * Microsoft.VisualStudio.Text.SnapshotPoint * Microsoft.VisualStudio.Text.SnapshotSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.CompletionContext>
Public Function GetCompletionContextAsync (trigger As InitialTrigger, triggerLocation As SnapshotPoint, applicableToSpan As SnapshotSpan, token As CancellationToken) As Task(Of CompletionContext)

Parameters

trigger
InitialTrigger

What caused the completion

triggerLocation
SnapshotPoint

Location where completion was triggered, on the subject buffer that matches this IAsyncCompletionSource's content type

applicableToSpan
SnapshotSpan

Location where completion will take place, on the view's data buffer: TextBuffer

token
CancellationToken

Cancellation token that may interrupt this operation

Returns

A struct that holds completion items and applicable span

Applies to

GetCompletionContextAsync(IAsyncCompletionSession, CompletionTrigger, SnapshotPoint, SnapshotSpan, CancellationToken)

Called once per completion session to fetch the set of all completion items available at a given location. Called on a background thread.

public:
 System::Threading::Tasks::Task<Microsoft::VisualStudio::Language::Intellisense::AsyncCompletion::Data::CompletionContext ^> ^ GetCompletionContextAsync(Microsoft::VisualStudio::Language::Intellisense::AsyncCompletion::IAsyncCompletionSession ^ session, Microsoft::VisualStudio::Language::Intellisense::AsyncCompletion::Data::CompletionTrigger trigger, Microsoft::VisualStudio::Text::SnapshotPoint triggerLocation, Microsoft::VisualStudio::Text::SnapshotSpan applicableToSpan, System::Threading::CancellationToken token);
public System.Threading.Tasks.Task<Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.CompletionContext> GetCompletionContextAsync (Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSession session, Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.CompletionTrigger trigger, Microsoft.VisualStudio.Text.SnapshotPoint triggerLocation, Microsoft.VisualStudio.Text.SnapshotSpan applicableToSpan, System.Threading.CancellationToken token);
abstract member GetCompletionContextAsync : Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSession * Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.CompletionTrigger * Microsoft.VisualStudio.Text.SnapshotPoint * Microsoft.VisualStudio.Text.SnapshotSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.CompletionContext>
Public Function GetCompletionContextAsync (session As IAsyncCompletionSession, trigger As CompletionTrigger, triggerLocation As SnapshotPoint, applicableToSpan As SnapshotSpan, token As CancellationToken) As Task(Of CompletionContext)

Parameters

session
IAsyncCompletionSession

Reference to the active IAsyncCompletionSession

trigger
CompletionTrigger

What caused the completion

triggerLocation
SnapshotPoint

Location where completion was triggered, on the subject buffer that matches this IAsyncCompletionSource's content type

applicableToSpan
SnapshotSpan

Location where completion will take place, on the view's data buffer: TextBuffer

token
CancellationToken

Cancellation token that may interrupt this operation

Returns

Data structure which holds completion items and hints regarding their presentation

Applies to