Geany dev
Data Fields
PluginExtension Struct Reference

Structure serving as an interface between plugins and Geany allowing plugins to inform Geany about what features they provide and allowing Geany to delegate its functionality to the plugins. More...

#include <pluginextension.h>

Data Fields

void(* autocomplete_perform )(GeanyDocument *doc, gboolean force, gpointer data)
 Pointer to function called by Geany to inform the plugin to perform autocompletion, e.g by showing an autocompletion popup window with suggestions. More...
 
gboolean(* autocomplete_provided )(GeanyDocument *doc, gpointer data)
 Pointer to function called by Geany to check whether the plugin implements autocompletion for the provided document. More...
 
gboolean(* calltips_provided )(GeanyDocument *doc, gpointer data)
 Pointer to function called by Geany to check whether the plugin implements calltips containing function signatures for the provided document. More...
 
void(* calltips_show )(GeanyDocument *doc, gboolean force, gpointer data)
 Pointer to function called by Geany to inform the plugin to show calltips. More...
 
gboolean(* goto_perform )(GeanyDocument *doc, gint pos, gboolean definition, gpointer data)
 Pointer to function called by Geany to inform the plugin to perform symbol goto. More...
 
gboolean(* goto_provided )(GeanyDocument *doc, gpointer data)
 Pointer to function called by Geany to check whether the plugin implements symbol definition/declaration goto functionality. More...
 
gboolean(* symbol_highlight_provided )(GeanyDocument *doc, gpointer data)
 Pointer to function called by Geany to check whether the plugin implements additional symbol (e.g. More...
 

Detailed Description

Structure serving as an interface between plugins and Geany allowing plugins to inform Geany about what features they provide and allowing Geany to delegate its functionality to the plugins.

Depending on the functionality they provide, plugins should assign pointers to the functions implementing this interface to the appropriate members of the structure. Not all of the functions have to be implemented by the plugin - member pointers of unimplemented functions can be left to contain the NULL pointer.

Typically, functions from this interface come in pairs. Functions assigned to the members ending with _provided inform Geany whether the plugin implements the given feature for the passed document. Functions assigned to the members ending with _perform are called by Geany at appropriate moments to inform the plugin when to perform the given feature.

The extension is defined by the pointers in the PluginExtension structure and is registered in Geany using the plugin_extension_register() function.

Warning
The API provided by this file is subject to change and should not be considered stable at this point. That said, it is highly probable that if a change of this API is required in the future, it will not be of a major nature and should not require major modifications of the affected plugins (e.g. added/modified parameter of a function and similar changes).

Field Documentation

◆ autocomplete_perform

void(* PluginExtension::autocomplete_perform) (GeanyDocument *doc, gboolean force, gpointer data)

Pointer to function called by Geany to inform the plugin to perform autocompletion, e.g by showing an autocompletion popup window with suggestions.

Parameters
docThe document for which autocompletion is being performed.
forceTRUE when autocompletion was requested explicitly by the user, e.g. by pressing a keybinding requesting the autocompletion popup to appear. FALSE means autocompletion is being auto-performed as the user types, possibly allowing the plugin not to do anything if there are no meaningful suggestions.
dataUser data passed during the plugin_extension_register() call.
Since
2.1

◆ autocomplete_provided

gboolean(* PluginExtension::autocomplete_provided) (GeanyDocument *doc, gpointer data)

Pointer to function called by Geany to check whether the plugin implements autocompletion for the provided document.

Parameters
docThe document for which Geany is querying whether the plugin provides autocompletion. This allows plugins to restrict their autocompletion implementation to documents of specific filetypes or other characteristics.
dataUser data passed during the plugin_extension_register() call.
Returns
Plugins should return TRUE if they impelment autocompletion for the provided document, FALSE otherwise.
Since
2.1

◆ calltips_provided

gboolean(* PluginExtension::calltips_provided) (GeanyDocument *doc, gpointer data)

Pointer to function called by Geany to check whether the plugin implements calltips containing function signatures for the provided document.

See also
autocomplete_provided() for more details.
Since
2.1

◆ calltips_show

void(* PluginExtension::calltips_show) (GeanyDocument *doc, gboolean force, gpointer data)

Pointer to function called by Geany to inform the plugin to show calltips.

See also
autocomplete_perform() for more details.
Since
2.1

◆ goto_perform

gboolean(* PluginExtension::goto_perform) (GeanyDocument *doc, gint pos, gboolean definition, gpointer data)

Pointer to function called by Geany to inform the plugin to perform symbol goto.

Parameters
docThe document for which symbol goto is being performed.
posScintilla position in the document at which the goto request was invoked (typically corresponds to the caret position or the position where the corresponding mouse event happened).
definitionIf TRUE, this is the go to definition request, if FALSE, this is the goto declaration request.
dataUser data passed during the plugin_extension_register() call.
Returns
Plugins should return TRUE if the goto was performed, FALSE otherwise. Plugins that work asynchronously and do not know the result at the moment this function is called should return TRUE. However, such plugins can perform some synchronous pre-check such as whether there is an identifier at the caret position and if the necessary conditions are not satisfied and the plugins know that goto cannot be performed, they should return FALSE.
Since
2.1

◆ goto_provided

gboolean(* PluginExtension::goto_provided) (GeanyDocument *doc, gpointer data)

Pointer to function called by Geany to check whether the plugin implements symbol definition/declaration goto functionality.

See also
autocomplete_provided() for more details.
Since
2.1

◆ symbol_highlight_provided

gboolean(* PluginExtension::symbol_highlight_provided) (GeanyDocument *doc, gpointer data)

Pointer to function called by Geany to check whether the plugin implements additional symbol (e.g.

type) highlighting in Scintilla.

See also
autocomplete_provided() for more details.
Note
There is no function in the PluginExtension structure informing plugins to perform symbol highlighting. Plugins implementing symbol highlighting should perform it at the appropriate moments based on Scintilla and Geany events such as when the document becomes visible or when the document is modified.
Since
2.1