Class: GtkSource::SnippetManager

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.defaultGtkSource::SnippetManager

Returns the default Gtk::SourceSnippetManager instance.

Returns:

  • (GtkSource::SnippetManager)

    a Gtk::SourceSnippetManager which is owned by GtkSourceView library and must not be unref'd.

Instance Method Details

#get_snippet(group, language_id, trigger) ⇒ GtkSource::Snippet

Queries the known snippets for the first matching group, language_id, and/or trigger.

If group or language_id are nil, they will be ignored.

Parameters:

  • group (String)

    a group name or nil

  • language_id (String)

    a Gtk::SourceLanguage:id or nil

  • trigger (String)

    the trigger for the snippet

Returns:

#list_allGio::ListModel

Gets a [ifaceGio.ListModel] of all snippets.

This can be used to get an unfiltered list of all of the snippets known to the snippet manager.

Returns:

  • (Gio::ListModel)

    a [ifaceGio.ListModel] of [classGtkSource.Snippet]

#list_groupsArray<String>

List all the known groups within the snippet manager.

The result should be freed with g_free(), and the individual strings are owned by self and should never be freed by the caller.

Returns:

  • (Array<String>)

    An array of strings which should be freed with g_free().

#list_matching(group, language_id, trigger_prefix) ⇒ Gio::ListModel

Queries the known snippets for those matching group, language_id, and/or trigger_prefix.

If any of these are nil, they will be ignored when filtering the available snippets.

The [ifaceGio.ListModel] only contains information about the available snippets until [methodGio.ListModel.get_item] is called for a specific snippet. This helps reduce the number of [classGObject.Object]'s that are created at runtime to those needed by the calling application.

Parameters:

  • group (String)

    a group name or nil

  • language_id (String)

    a Gtk::SourceLanguage:id or nil

  • trigger_prefix (String)

    a prefix for a trigger to activate

Returns:

  • (Gio::ListModel)

    a GList::Model of #GtkSourceSnippet.

#search_pathGtkSource::

Contains a list of directories to search for files containing snippets (*.snippets).

Returns:

#search_path=(search_path) ⇒ GtkSource::

Contains a list of directories to search for files containing snippets (*.snippets).

Parameters:

Returns: