IAsyncCompletionUniversalSource Interface
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.
Represents an object that provides CompletionItems and other information relevant to the completion feature at a specific SnapshotPoint.
This object provides CompletionItems without prior initialization. Only GetCompletionContextAsync(CompletionTrigger, SnapshotPoint, CancellationToken) will be called. Methods of base interface IAsyncCompletionSource may return default results.
public interface class IAsyncCompletionUniversalSource : Microsoft::VisualStudio::Language::Intellisense::AsyncCompletion::IAsyncCompletionSource
public interface IAsyncCompletionUniversalSource : Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSource
type IAsyncCompletionUniversalSource = interface
interface IAsyncCompletionSource
Public Interface IAsyncCompletionUniversalSource
Implements IAsyncCompletionSource
- Implements
Remarks
Instances of this class should be created by IAsyncCompletionSourceProvider, which is a MEF part.
Methods
GetCompletionContextAsync(CompletionTrigger, SnapshotPoint, CancellationToken) |
Called to fetch set of all completion items available at a given location, without pre-existing completion session. Called on a background thread. |
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) |
HandleTypedChar(IAsyncCompletionSession, CompletionItem, SnapshotPoint, Char, CancellationToken) |
Returns how Called instead of ShouldCommitCompletion(IAsyncCompletionSession, SnapshotPoint, Char, CancellationToken) and instead of HandleTypedChar(IAsyncCompletionSession, SnapshotPoint, Char, CancellationToken) if selected item's Source is IAsyncCompletionUniversalSource. Called on UI 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 |
TryCommit(IAsyncCompletionSession, ITextBuffer, CompletionItem, Char, CancellationToken) |
Allows the implementer of IAsyncCompletionCommitManager to customize how specified CompletionItem is committed.
This method is called on UI thread, before the In most cases, implementer does not need to commit the item. Return Unhandled to allow another IAsyncCompletionCommitManager to attempt the commit, or to invoke the default commit behavior.
To perform a custom commit, replace contents of
Called on UI thread. |
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 |