Partager via


IAsyncCompletionSessionOperations Interface

Definition

Exposes non-public functionality to commanding and tests

public interface class IAsyncCompletionSessionOperations : Microsoft::VisualStudio::Language::Intellisense::AsyncCompletion::IAsyncCompletionSession, Microsoft::VisualStudio::Utilities::IPropertyOwner
public interface IAsyncCompletionSessionOperations : Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSession, Microsoft.VisualStudio.Utilities.IPropertyOwner
type IAsyncCompletionSessionOperations = interface
    interface IAsyncCompletionSession
    interface IPropertyOwner
Public Interface IAsyncCompletionSessionOperations
Implements IAsyncCompletionSession, IPropertyOwner
Implements

Properties

ApplicableToSpan

Sets span applicable to this completion session. The span is defined on the session's TextBuffer.

InitialTrigger

Returns the intial trigger

InitialTriggerLocation

Returns the location of the initial trigger

IsDismissed

Returns whether session is dismissed. When session is dismissed, all work is canceled.

(Inherited from IAsyncCompletionSession)
IsStarted

Returns whether computation has begun. Computation starts after calling OpenOrUpdate(CompletionTrigger, SnapshotPoint, CancellationToken)

Properties

The collection of properties controlled by the property owner.

(Inherited from IPropertyOwner)
TextView

Returns the ITextView this session is active on.

(Inherited from IAsyncCompletionSession)

Methods

Commit(Char, CancellationToken)

Commits the currently selected CompletionItem. Must be called on UI thread.

(Inherited from IAsyncCompletionSession)
CommitIfUnique(CancellationToken)

Commits the single CompletionItem or opens the completion UI. Must be called on UI thread.

(Inherited from IAsyncCompletionSession)
CommitIfUniqueAsync(CancellationToken)

Starts asynchronous computation, which results in either committing of the single CompletionItem or opening the completion UI. Calling OpenOrUpdate(CompletionTrigger, SnapshotPoint, CancellationToken) cancels the operation and dismisses the session. Must be called on the UI thread to correctly set state of the session.

CreateCompletionList<T>(IEnumerable<T>)

Creates session-scoped readonly list of CompletionItems or CompletionItemWithHighlights capable of efficient storing of large number of items.

(Inherited from IAsyncCompletionSession)
Dismiss()

Stops the session and hides associated UI. May be called from any thread.

(Inherited from IAsyncCompletionSession)
GetComputedItems(CancellationToken)

Gets items visible in the UI and information about selection. This is a blocking call. As a side effect, prevents the UI from displaying.

(Inherited from IAsyncCompletionSession)
InvokeAndCommitIfUnique(CompletionTrigger, SnapshotPoint, CancellationToken)

Commits unique item. If no items were computed, performs computation. If there is no unique item, shows the UI.

OpenOrUpdate(CompletionTrigger, SnapshotPoint, CancellationToken)

Request completion to be opened or updated in a given location, the completion items to be filtered and sorted, and the UI updated. Must be called on UI thread. Enqueues work on a worker thread.

(Inherited from IAsyncCompletionSession)
OpenOrUpdate(InitialTrigger, SnapshotPoint, CancellationToken)

Request completion to be opened or updated in a given location, the completion items to be filtered and sorted, and the UI updated. Must be called on UI thread. Enqueues work on a worker thread.

(Inherited from IAsyncCompletionSession)
SelectCompletionItem(CompletionItem)

Enqueues selection a specified item. When all queued tasks are completed, the UI updates.

SelectDown()

Enqueues selecting the next item. When all queued tasks are completed, the UI updates.

SelectPageDown()

Enqueues selecting the item on the next page. When all queued tasks are completed, the UI updates.

SelectPageUp()

Enqueues selecting the item on the previous page. When all queued tasks are completed, the UI updates.

SelectUp()

Enqueues selecting the previous item. When all queued tasks are completed, the UI updates.

SetSuggestionMode(Boolean)

Enqueues setting suggestion mode. When all queued tasks are completed, the UI updates.

ShouldCommit(Char, SnapshotPoint, CancellationToken)

Returns whether given text edit should result in committing this session. Since this method is on a typing hot path, it returns quickly if the typedChar is not found among characters collected from PotentialCommitCharacters Else, we map the top-buffer triggerLocation to subject buffers and query ShouldCommitCompletion(IAsyncCompletionSession, SnapshotPoint, Char, CancellationToken) to see whether any IAsyncCompletionCommitManager would like to commit completion. Must be called on UI thread.

(Inherited from IAsyncCompletionSession)

Events

Dismissed

Raised on UI thread when completion session is dismissed.

(Inherited from IAsyncCompletionSession)
ItemCommitted

Raised on UI thread when completion item is committed

(Inherited from IAsyncCompletionSession)
ItemsUpdated

Provides elements that are visible in the UI Raised on worker thread when filtering and sorting of items has finished. There may be more updates happening immediately after this update.

(Inherited from IAsyncCompletionSession)

Applies to