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 gtksource.view.View.

Snippets are defined in XML files which are loaded by the gtksource.snippet_manager.SnippetManager. Alternatively, applications can create snippets on demand and insert them into the gtksource.view.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 _getGType() static nothrow
GType _gType() @property nothrow
Snippet self() nothrowReturns `this`, for use in `with` statements.
SnippetGidBuilder builder() static nothrowGet builder for [gtksource.snippet.Snippet] Returns: New builder object
string description() @property nothrow
void description(string propval) @property nothrow
int focusPosition() @property nothrow
string languageId() @property nothrow
void languageId(string propval) @property nothrow
string name() @property nothrow
void name(string propval) @property nothrow
string trigger() @property nothrow
void trigger(string propval) @property nothrow
gtksource.snippet.Snippet newParsed(string text) staticParses the snippet formatted text into a series of chunks and adds them to a new #GtkSourceSnippet.
void addChunk(gtksource.snippet_chunk.SnippetChunk chunk) nothrowAppends chunk to the snippet.
gtksource.snippet.Snippet copy() nothrowDoes a deep copy of the snippet. Returns: A new #GtkSourceSnippet
gtksource.snippet_context.SnippetContext getContext() nothrowGets the context used for expanding the snippet. Returns: an #GtkSourceSnippetContext
string getDescription() nothrowGets the description for the snippet. Returns:
int getFocusPosition() nothrowGets the current focus for the snippet.
string getLanguageId() nothrowGets the language-id used for the source snippet.
uint getNChunks() nothrowGets the number of chunks in the snippet.
string getName() nothrowGets the name for the snippet. Returns:
gtksource.snippet_chunk.SnippetChunk getNthChunk(uint nth) nothrowGets the chunk at nth.
string getTrigger() nothrowGets the trigger for the source snippet.
void setDescription(string description) nothrowSets the description for the snippet.
void setLanguageId(string languageId) nothrowSets the language identifier for the snippet.
void setName(string name) nothrowSets the name for the snippet.
void setTrigger(string trigger) nothrowSets the trigger for the snippet.
Constructors
this(void * ptr, Flag!"Take" take)
this(string trigger = null, string languageId = null)Creates a new #GtkSourceSnippet

Fluent builder implementation template for gtksource.snippet.Snippet

Methods
T description(string propval) nothrow
T languageId(string propval) nothrow
T name(string propval) nothrow
T trigger(string propval) nothrow

Fluent builder for gtksource.snippet.Snippet

Methods
Snippet build() nothrowCreate object from builder. Returns: New object