Augmenting GtkSourceCompletion

I’ve hooked up a buffer containing names of functions from the language I’m interested in, using gtk_source_completion_add_provider() and completion on those names works OK.

However, I’d like to enable this behavior: when a completion from that particular provider is activated, follow up by appending left and right parentheses and position the cursor between them, ready to insert arguments. Is there a mechanism (in any version of gtksourceview) that could support that? Thanks for any info.

Oops, sorry to reply to myself. But in case anyone else hasn’t figured this out: GtkSourceCompletionProviderIface is what’s needed, in particular its member function activate_proposal(). Customization goes there, if wanted.

You can use gtk_source_view_push_snippet() to add a snippet from completion activation, and that can have a focus-position between the parenthesis.