### Class

# GtkSource CompletionContext

#### Description [src]

    final class GtkSource.CompletionContext : GObject.Object
      implements Gio.ListModel {
      /* No available fields */
    }

The context of a completion.

`GtkSourceCompletionContext` contains information about an attept to display completion proposals to the user based on typed text in the `GtkSourceView`.

When typing, `GtkSourceCompletion` may use registered `GtkSourceCompletionProvider` to determine if there may be results which could be displayed. If so, a `GtkSourceCompletionContext` is created with information that is provided to the `GtkSourceCompletionProvider` to populate results which might be useful to the user.

`GtkSourceCompletionProvider` are expected to provide `GListModel` with `GtkSourceCompletionProposal` which may be joined together in a list of results for the user. They are also responsible for how the contents are displayed using `GtkSourceCompletionCell` which allows for some level of customization.

#### Ancestors

- GObject

#### Implements

- GListModel

#### Instance methods

###### gtk_source_completion_context_get_activation

Gets the mode for which the context was activated.

###### gtk_source_completion_context_get_bounds

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

###### gtk_source_completion_context_get_buffer

Gets the underlying buffer used by the context.

###### gtk_source_completion_context_get_busy

Gets the “busy” property. This is set to `TRUE` while the completion context is actively fetching proposals from registered `GtkSourceCompletionProvider`‘s.

###### gtk_source_completion_context_get_completion

Gets the `GtkSourceCompletion` that created the context.

###### gtk_source_completion_context_get_empty

Checks if any proposals have been provided to the context.

###### gtk_source_completion_context_get_language

Gets the language of the underlying buffer, if any.

###### gtk_source_completion_context_get_proposals_for_provider

Gets the `GListModel` associated with the provider.

since: 5.6

###### gtk_source_completion_context_get_view

Gets the text view for the context.

###### gtk_source_completion_context_get_word

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

###### gtk_source_completion_context_list_providers

Gets the providers that are associated with the context.

since: 5.6

###### gtk_source_completion_context_set_proposals_for_provider

This function allows providers to update their results for a context outside of a call to `gtk_source_completion_provider_populate_async()`.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

##### Methods inherited from GListModel (5)

###### g_list_model_get_item

Get the item at `position`.

###### g_list_model_get_item_type

Gets the type of the items in `list`.

###### g_list_model_get_n_items

Gets the number of items in `list`.

###### g_list_model_get_object

Get the item at `position`.

###### g_list_model_items_changed

Emits the `GListModel::items-changed` signal on `list`.

#### Properties

###### GtkSource.CompletionContext:busy

The “busy” property is `TRUE` while the completion context is populating completion proposals.

###### GtkSource.CompletionContext:completion

The “completion” is the `GtkSourceCompletion` that was used to create the context.

###### GtkSource.CompletionContext:empty

The “empty” property is `TRUE` when there are no results.

#### Signals

###### GtkSource.CompletionContext::provider-model-changed

Emitted when a provider changes a model.

since: 5.6

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

##### Signals inherited from GListModel (1)

###### GListModel::items-changed

This signal is emitted whenever items were added to or removed from `list`. At `position`, `removed` items were removed and `added` items were added in their place.

#### Class structure

    struct GtkSourceCompletionContextClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.