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 class@View.
When typing, class@Completion may use registered iface@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 iface@CompletionProvider to populate results which might be useful to the user.
iface@CompletionProvider are expected to provide [gio.list_model.ListModel] with iface@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 class@CompletionCell which allows for some level of customization.
CompletionContext self()Returns `this`, for use in `with` statements.CompletionContextGidBuilder builder()Get builder for [gtksource.completion_context.CompletionContext] Returns: New builder objectbool busy() @propertyGet `busy` property. Returns: The "busy" property is true while the completion context is populating completion proposals.gtksource.completion.Completion completion() @propertyGet `completion` property. Returns: The "completion" is the #GtkSourceCompletion that was used to create the context.bool empty() @propertyGet `empty` property. Returns: The "empty" property is true when there are no results.gtksource.types.CompletionActivation getActivation()Gets the mode for which the context was activated. Returns:bool getBounds(out gtk.text_iter.TextIter begin, out gtk.text_iter.TextIter end)Gets 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()Gets the underlying buffer used by the context.bool getBusy()Gets 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 busygtksource.completion.Completion getCompletion()Gets the #GtkSourceCompletion that created the context. Returns: an #GtkSourceCompletion or nullbool getEmpty()Checks if any proposals have been provided to the context.gtksource.language.Language getLanguage()Gets the language of the underlying buffer, if any. Returns: a #GtkSourceLanguage or nullgio.list_model.ListModel getProposalsForProvider(gtksource.completion_provider.CompletionProvider provider)Gets the #GListModel associated with the provider.gtksource.view.View getView()Gets the text view for the context. Returns: a #GtkSourceView or nullstring getWord()Gets the word that is being completed up to the position of the insert mark. Returns: a string containing the current wordgio.list_model.ListModel listProviders()Gets the providers that are associated with the context. Returns: a #GListModel of #GtkSourceCompletionProvidervoid setProposalsForProvider(gtksource.completion_provider.CompletionProvider provider, gio.list_model.ListModel results = null)This 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)Connect to `ProviderModelChanged` signal.T completion(gtksource.completion.Completion propval)Set `completion` property. Params: propval = The "completion" is the #GtkSourceCompletion that was used to create the context. Returns: Builder instance for fluent chainingFluent builder for [gtksource.completion_context.CompletionContext]