CompletionProvider

Completion provider interface.

You must implement this interface to provide proposals to class@Completion.

In most cases, implementations of this interface will want to use vfunc@CompletionProvider.populate_async to asynchronously populate the results to avoid blocking the main loop.

Members

Functions

activate
void activate(gtksource.completion_context.CompletionContext context, gtksource.completion_proposal.CompletionProposal proposal)

This function requests proposal to be activated by the #GtkSourceCompletionProvider.

display
void display(gtksource.completion_context.CompletionContext context, gtksource.completion_proposal.CompletionProposal proposal, gtksource.completion_cell.CompletionCell cell)

This function requests that the #GtkSourceCompletionProvider prepares cell to display the contents of proposal.

getPriority
int getPriority(gtksource.completion_context.CompletionContext context)

This function should return the priority of self in context.

getTitle
string getTitle()

Gets the title of the completion provider, if any.

isTrigger
bool isTrigger(gtk.text_iter.TextIter iter, dchar ch)

This function is used to determine if a character inserted into the text editor should cause a new completion request to be triggered.

keyActivates
bool keyActivates(gtksource.completion_context.CompletionContext context, gtksource.completion_proposal.CompletionProposal proposal, uint keyval, gdk.types.ModifierType state)

This function is used to determine if a key typed by the user should activate proposal (resulting in committing the text to the editor).

listAlternates
gtksource.completion_proposal.CompletionProposal[] listAlternates(gtksource.completion_context.CompletionContext context, gtksource.completion_proposal.CompletionProposal proposal)

Providers should return a list of alternates to proposal or null if there are no alternates available.

populateAsync
void populateAsync(gtksource.completion_context.CompletionContext context, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Asynchronously requests that the provider populates the completion results for context.

populateFinish
gio.list_model.ListModel populateFinish(gio.async_result.AsyncResult result)

Completes an asynchronous operation to populate a completion provider.

refilter
void refilter(gtksource.completion_context.CompletionContext context, gio.list_model.ListModel model)

This function can be used to filter results previously provided to the classCompletionContext by the #GtkSourceCompletionProvider.