Class: GtkSource::CompletionContext

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#activationGtkSource::CompletionActivation

Gets the mode for which the context was activated.

#bufferGtkSource::Buffer

Gets the underlying buffer used by the context.

This is a convenience function to get the buffer via the Gtk::SourceCompletion property.

Returns:

#busyBoolean

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

Returns:

  • (Boolean)

    true if the context is busy

#busy=(busy) ⇒ Boolean

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

Parameters:

  • busy (Boolean)

Returns:

  • (Boolean)

    busy

  • (Boolean)

    busy

#busy?Boolean

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

Returns:

  • (Boolean)

    busy

#completionGtkSource::Completion

The "completion" is the Gtk::SourceCompletion that was used to create the context.

Returns:

#completion=(completion) ⇒ GtkSource::Completion

The "completion" is the Gtk::SourceCompletion that was used to create the context.

Parameters:

Returns:

#emptyBoolean

Checks if any proposals have been provided to the context.

Out of convenience, this function will return true if self is nil.

Returns:

  • (Boolean)

    true if there are no proposals in the context

#empty=(empty) ⇒ Boolean

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

It will be notified when the first result is added or the last result is removed.

Parameters:

  • empty (Boolean)

Returns:

  • (Boolean)

    empty

  • (Boolean)

    empty

#empty?Boolean

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

It will be notified when the first result is added or the last result is removed.

Returns:

  • (Boolean)

    empty

#get_bounds(begin, end) ⇒ 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.

If begin is non-nil, it will be set to the start position of the current word being completed.

If end is non-nil, it will be set to the insertion cursor for the current word being completed.

Parameters:

  • begin (Gtk::TextIter)

    a Gtk::TextIter

  • end (Gtk::TextIter)

    a Gtk::TextIter

Returns:

  • (Boolean)

    true if the marks are still valid and begin or end was set.

#get_proposals_for_provider(provider) ⇒ Gio::ListModel

Gets the GList::Model associated with the provider.

You can connect to Gtk::SourceCompletionContext::model-changed to receive notifications about when the model has been replaced by a new model.

Parameters:

Returns:

  • (Gio::ListModel)

    a GList::Model or nil

#languageGtkSource::Language

Gets the language of the underlying buffer, if any.

Returns:

#list_providersGio::ListModel

Gets the providers that are associated with the context.

Returns:

  • (Gio::ListModel)

    a GList::Model of #GtkSourceCompletionProvider

#set_proposals_for_provider(provider, results) ⇒ nil

This function allows providers to update their results for a context outside of a call to [methodCompletionProvider.populate_async].

This can be used to immediately return results for a provider while it does additional asynchronous work. Doing so will allow the completions to update while the operation is in progress.

Parameters:

Returns:

  • (nil)

#viewGtkSource::View

Gets the text view for the context.

Returns:

#wordString

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

Returns:

  • (String)

    a string containing the current word