IAsyncCompletionSession Interface

Definition

Represents a class that tracks completion within a single ITextView. Constructed and managed by an instance of IAsyncCompletionBroker

public interface class IAsyncCompletionSession : Microsoft::VisualStudio::Utilities::IPropertyOwner
public interface IAsyncCompletionSession : Microsoft.VisualStudio.Utilities.IPropertyOwner
type IAsyncCompletionSession = interface
    interface IPropertyOwner
Public Interface IAsyncCompletionSession
Implements IPropertyOwner
Derived
Implements

Properties

ApplicableToSpan

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

IsDismissed

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

Properties

The collection of properties controlled by the property owner.

(Inherited from IPropertyOwner)
TextView

Returns the ITextView this session is active on.

Methods

Commit(Char, CancellationToken)

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

CommitIfUnique(CancellationToken)

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

CreateCompletionList<T>(IEnumerable<T>)

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

Dismiss()

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

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.

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.

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.

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.

Events

Dismissed

Raised on UI thread when completion session is dismissed.

ItemCommitted

Raised on UI thread when completion item is committed

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.

Applies to