IAsyncExpandingCompletionSource Interface

Definition

Represents an object that provides CompletionItems and other information relevant to the completion feature at a specific SnapshotPoint. Additionally, this object has capability to provide additional CompletionItems in a reaction to user interacting with CompletionExpander. If this capability is not necessary, then it is sufficient to implement just IAsyncCompletionSource.

public interface class IAsyncExpandingCompletionSource : Microsoft::VisualStudio::Language::Intellisense::AsyncCompletion::IAsyncCompletionSource
public interface IAsyncExpandingCompletionSource : Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSource
type IAsyncExpandingCompletionSource = interface
    interface IAsyncCompletionSource
Public Interface IAsyncExpandingCompletionSource
Implements IAsyncCompletionSource
Implements

Remarks

Instances of this class should be created by IAsyncCompletionSourceProvider, which is a MEF part.

Methods

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.

(Inherited from IAsyncCompletionSource)
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.

(Inherited from IAsyncCompletionSource)
GetDescriptionAsync(CompletionItem, CancellationToken)

Returns tooltip associated with provided CompletionItem. The returned object will be rendered by IViewElementFactoryService. See its documentation for default supported types. You may export a IViewElementFactory to provide a renderer for a custom type. Since this method is called on a background thread and on multiple platforms, an instance of UIElement may not be returned.

(Inherited from IAsyncCompletionSource)
GetDescriptionAsync(IAsyncCompletionSession, CompletionItem, CancellationToken)

Returns tooltip associated with provided CompletionItem. The returned object will be rendered by IViewElementFactoryService. See its documentation for default supported types. You may export a IViewElementFactory to provide a renderer for a custom type. Since this method is called on a background thread and on multiple platforms, an instance of UIElement may not be returned.

(Inherited from IAsyncCompletionSource)
GetExpandedCompletionContextAsync(IAsyncCompletionSession, CompletionExpander, CompletionTrigger, SnapshotSpan, CancellationToken)

Called when user interacts with expander buttons, requesting the completion source to provide additional completion items pertinent to the expander button. For best performance, do not provide Filters unless expansion should add new filters. Called on a background thread.

InitializeCompletion(CompletionTrigger, SnapshotPoint, CancellationToken)

Provides the span applicable to the prospective session. Called on UI thread and expected to return very quickly, based on syntactic clues. This method is called as a result of user action, after the Editor makes necessary changes in direct response to user's action. The state of the Editor prior to making the text edit is captured in ViewSnapshotBeforeTrigger of trigger. This method is called sequentially on available IAsyncCompletionSources until one of them returns CompletionStartData with appropriate level of Participation and one returns CompletionStartData with ApplicableToSpan If neither of the above conditions are met, no completion session will start.

(Inherited from IAsyncCompletionSource)
TryGetApplicableToSpan(Char, SnapshotPoint, SnapshotSpan, CancellationToken)

Provides the span applicable to the prospective session. Called on UI thread and expected to return very quickly, based on textual information. This method is called sequentially on available IAsyncCompletionSources until one of them returns true. Returning false does not exclude this source from participating in completion session. If no IAsyncCompletionSources return true, there will be no completion session.

(Inherited from IAsyncCompletionSource)

Applies to