IAsyncCompletionBroker.TriggerCompletion Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
TriggerCompletion(ITextView, CompletionTrigger, SnapshotPoint, CancellationToken) |
Activates completion and returns IAsyncCompletionSession.
If completion was already active, returns the existing session without changing it.
Returns null when |
TriggerCompletion(ITextView, SnapshotPoint, Char, CancellationToken) |
Activates completion and returns IAsyncCompletionSession. If completion was already active, returns the existing session without changing it. Must be invoked on UI thread. This does not cause the completion popup to appear. To compute available icons and display the UI, call OpenOrUpdate(InitialTrigger, SnapshotPoint, CancellationToken). Invoke IsCompletionSupported(IContentType) prior to invoking this method to more efficiently verify whether feature is disabled or if there are no completion providers. |
TriggerCompletion(ITextView, CompletionTrigger, SnapshotPoint, CancellationToken)
Activates completion and returns IAsyncCompletionSession.
If completion was already active, returns the existing session without changing it.
Returns null when token
is canceled, there are no participating IAsyncCompletionSources or completion is not applicable at the given triggerLocation
.
Must be invoked on UI thread.
This does not cause the completion popup to appear.
To compute available icons and display the UI, call OpenOrUpdate(CompletionTrigger, SnapshotPoint, CancellationToken).
Invoke IsCompletionSupported(IContentType) prior to invoking this method to more efficiently verify whether feature is disabled or if there are no completion providers.
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, 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, System.Threading.CancellationToken token);
abstract member TriggerCompletion : Microsoft.VisualStudio.Text.Editor.ITextView * Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.CompletionTrigger * Microsoft.VisualStudio.Text.SnapshotPoint * System.Threading.CancellationToken -> Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSession
Public Function TriggerCompletion (textView As ITextView, trigger As CompletionTrigger, triggerLocation As SnapshotPoint, 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
- 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 if there are no applicable completion providers. Invoke IsCompletionSupported(IContentType) prior to invoking this method to perform this check more efficiently.
Returns null if applicable IAsyncCompletionSources determine that completion is not applicable at the given triggerLocation
.
Returns a new IAsyncCompletionSession. Invoke OpenOrUpdate(CompletionTrigger, SnapshotPoint, CancellationToken) to compute and display the available completions.
Applies to
TriggerCompletion(ITextView, SnapshotPoint, Char, CancellationToken)
Activates completion and returns IAsyncCompletionSession. If completion was already active, returns the existing session without changing it. Must be invoked on UI thread. This does not cause the completion popup to appear. To compute available icons and display the UI, call OpenOrUpdate(InitialTrigger, SnapshotPoint, CancellationToken). Invoke IsCompletionSupported(IContentType) prior to invoking this method to more efficiently verify whether feature is disabled or if there are no completion providers.
public:
Microsoft::VisualStudio::Language::Intellisense::AsyncCompletion::IAsyncCompletionSession ^ TriggerCompletion(Microsoft::VisualStudio::Text::Editor::ITextView ^ textView, Microsoft::VisualStudio::Text::SnapshotPoint triggerLocation, char typedChar, System::Threading::CancellationToken token);
public Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSession TriggerCompletion (Microsoft.VisualStudio.Text.Editor.ITextView textView, Microsoft.VisualStudio.Text.SnapshotPoint triggerLocation, char typedChar, System.Threading.CancellationToken token);
abstract member TriggerCompletion : Microsoft.VisualStudio.Text.Editor.ITextView * Microsoft.VisualStudio.Text.SnapshotPoint * char * System.Threading.CancellationToken -> Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSession
Public Function TriggerCompletion (textView As ITextView, triggerLocation As SnapshotPoint, typedChar As Char, token As CancellationToken) As IAsyncCompletionSession
Parameters
- textView
- ITextView
View that hosts completion and relevant buffers
- triggerLocation
- SnapshotPoint
Location of completion on the view's data buffer: TextBuffer. Used to pick relevant IAsyncCompletionSources and IAsyncCompletionItemManager
- typedChar
- Char
- token
- CancellationToken
Cancellation token that may interrupt this operation, despire running on the UI thread
Returns
Returns existing IAsyncCompletionSession if one already exists
Returns null if the completion feature is disabled or if there are no applicable completion providers. Invoke IsCompletionSupported(IContentType) prior to invoking this method to perform this check more efficiently.
Returns null if applicable IAsyncCompletionSources determine that completion is not applicable at the given triggerLocation
.
Returns a new IAsyncCompletionSession. Invoke OpenOrUpdate(InitialTrigger, SnapshotPoint, CancellationToken) to compute and display the available completions.