gtksource.completion_context

Module for [CompletionContext] class

Types 3

The context of a completion.

gtksource.completion_context.CompletionContext contains information about an attept to display completion proposals to the user based on typed text in the gtksource.view.View.

When typing, gtksource.completion.Completion may use registered gtksource.completion_provider.CompletionProvider to determine if there may be results which could be displayed. If so, a gtksource.completion_context.CompletionContext is created with information that is provided to the gtksource.completion_provider.CompletionProvider to populate results which might be useful to the user.

gtksource.completion_provider.CompletionProvider are expected to provide gio.list_model.ListModel with gtksource.completion_proposal.CompletionProposal which may be joined together in a list of results for the user. They are also responsible for how the contents are displayed using gtksource.completion_cell.CompletionCell which allows for some level of customization.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
CompletionContext self() nothrowReturns `this`, for use in `with` statements.
CompletionContextGidBuilder builder() static nothrowGet builder for [gtksource.completion_context.CompletionContext] Returns: New builder object
bool busy() @property nothrowGet `busy` property. Returns: The "busy" property is true while the completion context is populating completion proposals.
gtksource.completion.Completion completion() @property nothrowGet `completion` property. Returns: The "completion" is the #GtkSourceCompletion that was used to create the context.
bool empty() @property nothrowGet `empty` property. Returns: The "empty" property is true when there are no results.
gtksource.types.CompletionActivation getActivation() nothrowGets the mode for which the context was activated. Returns:
bool getBounds(out gtk.text_iter.TextIter begin, out gtk.text_iter.TextIter end) nothrowGets the bounds for the completion, which is the beginning of the current word (taking break characters into account) to the current insertion cursor.
gtksource.buffer.Buffer getBuffer() nothrowGets the underlying buffer used by the context.
bool getBusy() nothrowGets the "busy" property. This is set to true while the completion context is actively fetching proposals from registered #GtkSourceCompletionProvider's. Returns: true if the context is busy
gtksource.completion.Completion getCompletion() nothrowGets the #GtkSourceCompletion that created the context. Returns: an #GtkSourceCompletion or null
bool getEmpty() nothrowChecks if any proposals have been provided to the context.
gtksource.language.Language getLanguage() nothrowGets the language of the underlying buffer, if any. Returns: a #GtkSourceLanguage or null
gio.list_model.ListModel getProposalsForProvider(gtksource.completion_provider.CompletionProvider provider) nothrowGets the #GListModel associated with the provider.
gtksource.view.View getView() nothrowGets the text view for the context. Returns: a #GtkSourceView or null
string getWord() nothrowGets the word that is being completed up to the position of the insert mark. Returns: a string containing the current word
gio.list_model.ListModel listProviders() nothrowGets the providers that are associated with the context. Returns: a #GListModel of #GtkSourceCompletionProvider
void setProposalsForProvider(gtksource.completion_provider.CompletionProvider provider, gio.list_model.ListModel results = null) nothrowThis function allows providers to update their results for a context outside of a call to [gtksource.completion_provider.CompletionProvider.populateAsync].
gulong connectProviderModelChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtksource.completion_provider.CompletionProvider))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gio.list_model.ListModel))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtksource.completion_context.CompletionContext))) && Parameters!T.length < 4) nothrowConnect to `ProviderModelChanged` signal.
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder implementation template for gtksource.completion_context.CompletionContext

Methods
T completion(gtksource.completion.Completion propval) nothrowSet `completion` property. Params: propval = The "completion" is the #GtkSourceCompletion that was used to create the context. Returns: Builder instance for fluent chaining