Top | ![]() |
![]() |
![]() |
![]() |
gboolean | busy | Read |
GtkSourceCompletion * | completion | Read / Write / Construct Only |
gboolean | empty | Read |
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.
GtkSourceCompletionActivation
gtk_source_completion_context_get_activation
(GtkSourceCompletionContext *self
);
Gets the mode for which the context was activated.
Since: 5.0
gboolean gtk_source_completion_context_get_bounds (GtkSourceCompletionContext *self
,GtkTextIter *begin
,GtkTextIter *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.
If begin
is non-NULL
, it will be set to the start position of the
current word being completed.
If end
is non-NULL
, it will be set to the insertion cursor for the
current word being completed.
Since: 5.0
GtkSourceBuffer *
gtk_source_completion_context_get_buffer
(GtkSourceCompletionContext *self
);
Gets the underlying buffer used by the context.
This is a convenience function to get the buffer via the GtkSourceCompletion property.
Since: 5.0
gboolean
gtk_source_completion_context_get_busy
(GtkSourceCompletionContext *self
);
Gets the "busy" property. This is set to TRUE
while the completion
context is actively fetching proposals from registered
GtkSourceCompletionProvider's.
Since: 5.0
GtkSourceCompletion *
gtk_source_completion_context_get_completion
(GtkSourceCompletionContext *self
);
Gets the GtkSourceCompletion that created the context.
Since: 5.0
gboolean
gtk_source_completion_context_get_empty
(GtkSourceCompletionContext *self
);
Checks if any proposals have been provided to the context.
Out of convenience, this function will return TRUE
if self
is NULL
.
Since: 5.0
GtkSourceLanguage *
gtk_source_completion_context_get_language
(GtkSourceCompletionContext *self
);
Gets the language of the underlying buffer, if any.
Since: 5.0
void gtk_source_completion_context_get_start_iter (GtkSourceCompletionContext *self
,GtkTextIter *iter
);
GtkSourceView *
gtk_source_completion_context_get_view
(GtkSourceCompletionContext *self
);
Gets the text view for the context.
Since: 5.0
char *
gtk_source_completion_context_get_word
(GtkSourceCompletionContext *self
);
Gets the word that is being completed up to the position of the insert mark.
Since: 5.0
void gtk_source_completion_context_set_proposals_for_provider (GtkSourceCompletionContext *self
,GtkSourceCompletionProvider *provider
,GListModel *results
);
This function allows providers to update their results for a context
outside of a call to gtk_source_completion_provider_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.
Since: 5.0
“busy”
property“busy” gboolean
The "busy" property is TRUE
while the completion context is
populating completion proposals.
Owner: GtkSourceCompletionContext
Flags: Read
Default value: FALSE
Since: 5.0
“completion”
property“completion” GtkSourceCompletion *
The "completion" is the GtkSourceCompletion that was used to create the context.
Owner: GtkSourceCompletionContext
Flags: Read / Write / Construct Only
Since: 5.0