gtksource.snippet

Module for [Snippet] class

Types 3

Quick insertion code snippets.

The [gtksource.snippet.Snippet] represents a series of chunks that can quickly be inserted into the class@View.

Snippets are defined in XML files which are loaded by the class@SnippetManager. Alternatively, applications can create snippets on demand and insert them into the class@View using [gtksource.view.View.pushSnippet].

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

Methods
GType _gType() @property
Snippet self()Returns `this`, for use in `with` statements.
SnippetGidBuilder builder()Get builder for [gtksource.snippet.Snippet] Returns: New builder object
string description() @property
void description(string propval) @property
int focusPosition() @property
string languageId() @property
void languageId(string propval) @property
string name() @property
void name(string propval) @property
string trigger() @property
void trigger(string propval) @property
gtksource.snippet.Snippet newParsed(string text)Parses the snippet formatted text into a series of chunks and adds them to a new #GtkSourceSnippet.
void addChunk(gtksource.snippet_chunk.SnippetChunk chunk)Appends chunk to the snippet.
gtksource.snippet.Snippet copy()Does a deep copy of the snippet. Returns: A new #GtkSourceSnippet
gtksource.snippet_context.SnippetContext getContext()Gets the context used for expanding the snippet. Returns: an #GtkSourceSnippetContext
string getDescription()Gets the description for the snippet. Returns:
int getFocusPosition()Gets the current focus for the snippet.
string getLanguageId()Gets the language-id used for the source snippet.
uint getNChunks()Gets the number of chunks in the snippet.
string getName()Gets the name for the snippet. Returns:
gtksource.snippet_chunk.SnippetChunk getNthChunk(uint nth)Gets the chunk at nth.
string getTrigger()Gets the trigger for the source snippet.
void setDescription(string description)Sets the description for the snippet.
void setLanguageId(string languageId)Sets the language identifier for the snippet.
void setName(string name)Sets the name for the snippet.
void setTrigger(string trigger)Sets the trigger for the snippet.
Constructors
this(void * ptr, Flag!"Take" take)
this(string trigger = null, string languageId = null)Creates a new #GtkSourceSnippet
Methods
T description(string propval)
T languageId(string propval)
T name(string propval)
T trigger(string propval)

Fluent builder for [gtksource.snippet.Snippet]

Methods