gtksource.completion_provider_mixin

Module for [CompletionProvider] interface mixin

Templates 2

tmplCompletionProviderT()
Functions

Activate proposal at iter. When this functions returns false, the default activation of proposal will take place which replaces the word at iter with the text of proposal (see [gtksource.completion_proposal.CompletionProposal.getText]).

Here is how the default activation selects the boundaries of the word to replace. The end of the word is iter. For the start of the word, it depends on whether a start iter is defined for proposal (see [gtksource.completion_provider.CompletionProvider.getStartIter]). If a start iter is defined, the start of the word is the start iter. Else, the word (as long as possible) will contain only alphanumerical and the "_" characters.

Parameters

proposala #GtkSourceCompletionProposal.
itera #GtkTextIter.

Returns

true to indicate that the proposal activation has been handled,

false otherwise.

Get with what kind of activation the provider should be activated.

Returns

a combination of #GtkSourceCompletionActivation.
gio.icon.Icon getGicon()

Gets the #GIcon for the icon of provider.

Returns

The icon to be used for the provider,

or null if the provider does not have a special icon.

Get the #GdkPixbuf for the icon of the provider.

Returns

The icon to be used for the provider,

or null if the provider does not have a special icon.

string getIconName()

Gets the icon name of provider.

Returns

The icon name to be used for the provider,

or null if the provider does not have a special icon.

Get a customized info widget to show extra information of a proposal. This allows for customized widgets on a proposal basis, although in general providers will have the same custom widget for all their proposals and proposal can be ignored. The implementation of this function is optional.

If this function is not implemented, the default widget is a #GtkLabel. The return value of [gtksource.completion_proposal.CompletionProposal.getInfo] is used as the content of the #GtkLabel.

<note> <para>

If implemented, [gtksource.completion_provider.CompletionProvider.updateInfo]

<emphasis>must</emphasis> also be implemented. </para> </note>

Parameters

proposala currently selected #GtkSourceCompletionProposal.

Returns

a custom #GtkWidget to show extra

information about proposal, or null if the provider does not have a special info widget.

int getInteractiveDelay()

Get the delay in milliseconds before starting interactive completion for this provider. A value of -1 indicates to use the default value as set by the #GtkSourceCompletion:auto-complete-delay property.

Returns

the interactive delay in milliseconds.
string getName()

Get the name of the provider. This should be a translatable name for display to the user. For example: _("Document word completion provider"). The returned string must be freed with [glib.global.gfree].

Returns

a new string containing the name of the provider.
int getPriority()

Get the provider priority. The priority determines the order in which proposals appear in the completion popup. Higher priorities are sorted before lower priorities. The default priority is 0.

Returns

the provider priority.

Get the #GtkTextIter at which the completion for proposal starts. When implemented, this information is used to position the completion window accordingly when a proposal is selected in the completion window. The proposal text inside the completion window is aligned on iter.

If this function is not implemented, the word boundary is taken to position the completion window. See [gtksource.completion_provider.CompletionProvider.activateProposal] for an explanation on the word boundaries.

When the proposal is activated, the default handler uses iter as the start of the word to replace. See [gtksource.completion_provider.CompletionProvider.activateProposal] for more information.

Parameters

contexta #GtkSourceCompletionContext.
proposala #GtkSourceCompletionProposal.
itera #GtkTextIter.

Returns

true if iter was set for proposal, false otherwise.

Get whether the provider match the context of completion detailed in context.

Parameters

contexta #GtkSourceCompletionContext.

Returns

true if provider matches the completion context, false otherwise.

Populate context with proposals from provider added with the [gtksource.completion_context.CompletionContext.addProposals] function.

Parameters

contexta #GtkSourceCompletionContext.

Update extra information shown in info for proposal.

<note> <para>

This function <emphasis>must</emphasis> be implemented when [gtksource.completion_provider.CompletionProvider.getInfoWidget] is implemented.

</para> </note>

Parameters

proposala #GtkSourceCompletionProposal.
infoa #GtkSourceCompletionInfo.
tmplCompletionProviderGidBuilderT()