CompletionContext

open class CompletionContext(pointer: <Error class: unknown class><<Error class: unknown class>>)

The context of a completion.

GtkSourceCompletionContext 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 GtkSourceCompletionContext 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 iface@Gio.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.

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val busy: Boolean

The "busy" property is true while the completion context is populating completion proposals.

Link copied to clipboard

The "completion" is the #GtkSourceCompletion that was used to create the context.

Link copied to clipboard
open val empty: Boolean

The "empty" property is true when there are no results.

Link copied to clipboard
open val gioListModelPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gtksourceCompletionContextPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun connectProviderModelChanged(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (provider: CompletionProvider, <Error class: unknown class>?) -> Unit): <Error class: unknown class>

Emitted when a provider changes a model.

Link copied to clipboard

Gets the mode for which the context was activated.

Link copied to clipboard
open fun getBounds(begin: <Error class: unknown class>?, end: <Error class: unknown class>?): Boolean

Gets the bounds for the completion, which is the beginning of the current word (taking break characters into account) to the current insertion cursor.

Link copied to clipboard
open fun getBuffer(): Buffer?

Gets the underlying buffer used by the context.

Link copied to clipboard
open fun getBusy(): Boolean

Gets the "busy" property. This is set to true while the completion context is actively fetching proposals from registered #GtkSourceCompletionProvider's.

Link copied to clipboard

Gets the #GtkSourceCompletion that created the context.

Link copied to clipboard
open fun getEmpty(): Boolean

Checks if any proposals have been provided to the context.

Link copied to clipboard
open fun getLanguage(): Language?

Gets the language of the underlying buffer, if any.

Link copied to clipboard
open fun getProposalsForProvider(provider: CompletionProvider): <Error class: unknown class>?

Gets the #GListModel associated with the provider.

Link copied to clipboard
open fun getView(): View?

Gets the text view for the context.

Link copied to clipboard
open fun getWord(): String

Gets the word that is being completed up to the position of the insert mark.

Link copied to clipboard
open fun listProviders(): <Error class: unknown class>

Gets the providers that are associated with the context.

Link copied to clipboard
open fun setProposalsForProvider(provider: CompletionProvider, results: <Error class: unknown class>? = null)

This function allows providers to update their results for a context outside of a call to method@CompletionProvider.populate_async.