### Class

# GtkSource Snippet

#### Description [src]

    final class GtkSource.Snippet : GObject.Object
    {
      /* No available fields */
    }

Quick insertion code snippets.

The `GtkSourceSnippet` represents a series of chunks that can quickly be inserted into the `GtkSourceView`.

Snippets are defined in XML files which are loaded by the `GtkSourceSnippetManager`. Alternatively, applications can create snippets on demand and insert them into the `GtkSourceView` using `gtk_source_view_push_snippet()`.

Snippet chunks can reference other snippet chunks as well as post-process the values from other chunks such as capitalization.

#### Hierarchy

#### Ancestors

- GObject

#### Constructors

###### gtk_source_snippet_new

Creates a new `GtkSourceSnippet`.

###### gtk_source_snippet_new_parsed

Parses the snippet formatted `text` into a series of chunks and adds them to a new `GtkSourceSnippet`.

since: 5.6

#### Instance methods

###### gtk_source_snippet_add_chunk

Appends `chunk` to the `snippet`.

###### gtk_source_snippet_copy

Does a deep copy of the snippet.

###### gtk_source_snippet_get_context

Gets the context used for expanding the snippet.

###### gtk_source_snippet_get_description

Gets the description for the snippet.

###### gtk_source_snippet_get_focus_position

Gets the current focus for the snippet.

###### gtk_source_snippet_get_language_id

Gets the language-id used for the source snippet.

###### gtk_source_snippet_get_n_chunks

Gets the number of chunks in the snippet.

###### gtk_source_snippet_get_name

Gets the name for the snippet.

###### gtk_source_snippet_get_nth_chunk

Gets the chunk at `nth`.

###### gtk_source_snippet_get_trigger

Gets the trigger for the source snippet.

###### gtk_source_snippet_set_description

Sets the description for the snippet.

###### gtk_source_snippet_set_language_id

Sets the language identifier for the snippet.

###### gtk_source_snippet_set_name

Sets the name for the snippet.

###### gtk_source_snippet_set_trigger

Sets the trigger for the snippet.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### GtkSource.Snippet:buffer

No description available.

###### GtkSource.Snippet:description

No description available.

###### GtkSource.Snippet:focus-position

No description available.

###### GtkSource.Snippet:language-id

No description available.

###### GtkSource.Snippet:name

No description available.

###### GtkSource.Snippet:trigger

No description available.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GtkSourceSnippetClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.