Udostępnij za pośrednictwem


ISelectedItemProvider Interface

Definition

Indicates that the object is capable of returning a CompletionItem which is currently or has been recently selected.

public interface class ISelectedItemProvider
public interface ISelectedItemProvider
type ISelectedItemProvider = interface
Public Interface ISelectedItemProvider

Methods

GetSelectedItemAsync(GetSelectedItemOptions, CancellationToken)

Gets currently selected CompletionItem in accordance with GetSelectedItemOptions. Supplied options indicates the ration between wait length and accuracy of returned CompletionItem: The shorter wait comes with a tradeoff of receiving a potentially stale item or no item.

Passing GetLastAvailableItem leads to returning: Currently selected CompletionItem when completion is not changing; Currently selected CompletionItem when completion is reacting to user's input; null when completion user interface has not appeared yet. This is the fastest operation and does not yield current thread.

Passing WaitForComputation leads to returning: Currently selected CompletionItem when completion is not changing; CompletionItem which is going to be selected after reacting to user's input, if completion user interface is already visible; null when completion user interface has not appeared yet. This accommodates for selection after user types and scrolls with arrow keys, and may yield current thread for a short period of time.

Passing WaitForContextAndComputation leads to returning: Currently selected CompletionItem when completion is not changing; CompletionItem which is going to be selected after receiving items from the providers, sorting them, and reacting to outstanding user's input. This yields current thread until completion items are received and selected item is calculated.

Applies to