Snippet

open class Snippet(val gtksourceSnippetPointer: <Error class: unknown class><<Error class: unknown class>>)

Quick insertion code snippets.

The GtkSourceSnippet 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 method@View.push_snippet.

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

Skipped during bindings generation

  • method buffer: Property has no getter nor setter

  • method trigger: Property TypeInfo of getter and setter do not match

Constructors

Link copied to clipboard
constructor(trigger: String? = null, languageId: String? = null)

Creates a new #GtkSourceSnippet

constructor(text: String)

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

constructor(gtksourceSnippetPointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
open val focusPosition: <Error class: unknown class>
Link copied to clipboard
val gtksourceSnippetPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open var languageId: String
Link copied to clipboard
open var name: String

Functions

Link copied to clipboard
open fun addChunk(chunk: SnippetChunk)

Appends @chunk to the @snippet.

Link copied to clipboard
open fun copy(): Snippet

Does a deep copy of the snippet.

Link copied to clipboard

Gets the context used for expanding the snippet.

Link copied to clipboard
open fun getNChunks(): <Error class: unknown class>

Gets the number of chunks in the snippet.

Link copied to clipboard
open fun getNthChunk(nth: <Error class: unknown class>): SnippetChunk

Gets the chunk at @nth.

Link copied to clipboard
open fun getTrigger(): String?

Gets the trigger for the source snippet.

Link copied to clipboard
open fun setTrigger(trigger: String)

Sets the trigger for the snippet.