Partager via


IAsyncCompletionBroker2.TriggerCompletion Method

Definition

Activates completion and returns IAsyncCompletionSession. The IAsyncCompletionSession will contain items supplied through context.

public:
 Microsoft::VisualStudio::Language::Intellisense::AsyncCompletion::IAsyncCompletionSession ^ TriggerCompletion(Microsoft::VisualStudio::Text::Editor::ITextView ^ textView, Microsoft::VisualStudio::Language::Intellisense::AsyncCompletion::Data::CompletionTrigger trigger, Microsoft::VisualStudio::Text::SnapshotPoint triggerLocation, Microsoft::VisualStudio::Language::Intellisense::AsyncCompletion::Data::CompletionContext ^ context, System::Threading::CancellationToken token);
public Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSession TriggerCompletion (Microsoft.VisualStudio.Text.Editor.ITextView textView, Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.CompletionTrigger trigger, Microsoft.VisualStudio.Text.SnapshotPoint triggerLocation, Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.CompletionContext context, System.Threading.CancellationToken token);
abstract member TriggerCompletion : Microsoft.VisualStudio.Text.Editor.ITextView * Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.CompletionTrigger * Microsoft.VisualStudio.Text.SnapshotPoint * Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.CompletionContext * System.Threading.CancellationToken -> Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSession
Public Function TriggerCompletion (textView As ITextView, trigger As CompletionTrigger, triggerLocation As SnapshotPoint, context As CompletionContext, token As CancellationToken) As IAsyncCompletionSession

Parameters

textView
ITextView

View that hosts completion and relevant buffers

trigger
CompletionTrigger

What causes this completion, potentially including character typed by the user and snapshot before the text edit.

triggerLocation
SnapshotPoint

Location of completion on the view's data buffer: TextBuffer. Used to pick relevant IAsyncCompletionSources and IAsyncCompletionItemManager

context
CompletionContext

Location of completion on the view's data buffer: TextBuffer. Used to pick relevant IAsyncCompletionSources and IAsyncCompletionItemManager

token
CancellationToken

Cancellation token that may interrupt this operation, despite running on the UI thread

Returns

Returns existing IAsyncCompletionSession if one already exists Returns null if the completion feature is disabled or token is canceled Returns a new IAsyncCompletionSession otherwise. Computation will begin automatically and user will see the popup when the list of items is established.

Remarks

May be invoked on any thread. Causes the completion popup to appear.

Applies to