IdeSnippetContext

IdeSnippetContext — Context for expanding IdeSnippetChunk

Functions

Signals

void changed Run First

Types and Values

Object Hierarchy

    GObject
    ╰── IdeSnippetContext

Description

This class is currently used primary as a hashtable. However, the longer term goal is to have it hold onto a GjsContext as well as other languages so that IdeSnippetChunk can expand themselves by executing script within the context.

The IdeSnippet will build the context and then expand each of the chunks during the insertion/edit phase.

Functions

ide_snippet_context_new ()

IdeSnippetContext *
ide_snippet_context_new (void);

ide_snippet_context_emit_changed ()

void
ide_snippet_context_emit_changed (IdeSnippetContext *context);

ide_snippet_context_clear_variables ()

void
ide_snippet_context_clear_variables (IdeSnippetContext *context);

ide_snippet_context_add_variable ()

void
ide_snippet_context_add_variable (IdeSnippetContext *context,
                                  const gchar *key,
                                  const gchar *value);

ide_snippet_context_add_shared_variable ()

void
ide_snippet_context_add_shared_variable
                               (IdeSnippetContext *context,
                                const gchar *key,
                                const gchar *value);

ide_snippet_context_get_variable ()

const gchar *
ide_snippet_context_get_variable (IdeSnippetContext *context,
                                  const gchar *key);

ide_snippet_context_expand ()

gchar *
ide_snippet_context_expand (IdeSnippetContext *context,
                            const gchar *input);

ide_snippet_context_set_tab_width ()

void
ide_snippet_context_set_tab_width (IdeSnippetContext *context,
                                   gint tab_size);

ide_snippet_context_set_use_spaces ()

void
ide_snippet_context_set_use_spaces (IdeSnippetContext *context,
                                    gboolean use_spaces);

ide_snippet_context_set_line_prefix ()

void
ide_snippet_context_set_line_prefix (IdeSnippetContext *context,
                                     const gchar *line_prefix);

ide_snippet_context_dump ()

void
ide_snippet_context_dump (IdeSnippetContext *context);

Types and Values

IDE_TYPE_SNIPPET_CONTEXT

#define IDE_TYPE_SNIPPET_CONTEXT (ide_snippet_context_get_type())

IdeSnippetContext

typedef struct _IdeSnippetContext IdeSnippetContext;

Signal Details

The “changed” signal

void
user_function (IdeSnippetContext *idesnippetcontext,
               gpointer           user_data)

Flags: Run First