gtksource.snippet
Module for Snippet class
Types 3
classSnippet : gobject.object.ObjectWrap
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
SnippetGidBuilder builder()Get builder for [gtksource.snippet.Snippet] Returns: New builder objectgtk.text_buffer.TextBuffer buffer() @propertystring description() @propertyvoid description(string propval) @propertyint focusPosition() @propertystring languageId() @propertyvoid languageId(string propval) @propertystring name() @propertyvoid name(string propval) @propertystring trigger() @propertyvoid trigger(string propval) @propertygtksource.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 #GtkSourceSnippetgtksource.snippet_context.SnippetContext getContext()Gets the context used for expanding the snippet. Returns: an #GtkSourceSnippetContextstring 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.Fluent builder implementation template for gtksource.snippet.Snippet
Methods
T description(string propval)T languageId(string propval)T name(string propval)T trigger(string propval)Fluent builder for gtksource.snippet.Snippet