Snippet
Superclasses: Object
- Constructors:
Snippet(**properties)
new(trigger:str=None, language_id:str=None) -> GtkSource.Snippet
new_parsed(text:str) -> GtkSource.Snippet
Constructors
Methods
- class Snippet
- add_chunk(chunk: SnippetChunk) None
Appends
chunk
to thesnippet
.This may only be called before the snippet has been expanded.
- Parameters:
chunk – a
SnippetChunk
- get_context() SnippetContext | None
Gets the context used for expanding the snippet.
- get_focus_position() int
Gets the current focus for the snippet.
This is changed as the user tabs through focus locations.
- get_language_id() str
Gets the language-id used for the source snippet.
The language identifier should be one that matches a source language
id
property.
- get_n_chunks() int
Gets the number of chunks in the snippet.
Note that not all chunks are editable.
- get_nth_chunk(nth: int) SnippetChunk
Gets the chunk at
nth
.- Parameters:
nth – the nth chunk to get
- get_trigger() str | None
Gets the trigger for the source snippet.
A trigger is a word that can be expanded into the full snippet when the user presses Tab.
- set_description(description: str) None
Sets the description for the snippet.
- Parameters:
description – the snippet description