IdeSourceSnippetContext: Builder SDK Reference

## IdeSourceSnippetContext IdeSourceSnippetContext — Context for expanding IdeSourceSnippetChunk |

## Functions

IdeSourceSnippetContext * | ide_source_snippet_context_new ()
void | ide_source_snippet_context_emit_changed ()
void | ide_source_snippet_context_clear_variables ()
void | ide_source_snippet_context_add_variable ()
void | ide_source_snippet_context_add_shared_variable ()
const gchar * | ide_source_snippet_context_get_variable ()
gchar * | ide_source_snippet_context_expand ()
void | ide_source_snippet_context_set_tab_width ()
void | ide_source_snippet_context_set_use_spaces ()
void | ide_source_snippet_context_set_line_prefix ()
void | ide_source_snippet_context_dump ()

## Signals

void | changed | Run First

## Types and Values

#define | IDE_TYPE_SOURCE_SNIPPET_CONTEXT
| IdeSourceSnippetContext

## Object Hierarchy

        GObject
        ╰── IdeSourceSnippetContext

## 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 IdeSourceSnippetChunk can expand themselves by executing script within the context.

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

## Functions

### ide_source_snippet_context_new ()

    IdeSourceSnippetContext *
    ide_source_snippet_context_new (void);

### ide_source_snippet_context_emit_changed ()

    void
    ide_source_snippet_context_emit_changed
                                   (IdeSourceSnippetContext *context);

### ide_source_snippet_context_clear_variables ()

    void
    ide_source_snippet_context_clear_variables
                                   (IdeSourceSnippetContext *context);

### ide_source_snippet_context_add_variable ()

    void
    ide_source_snippet_context_add_variable
                                   (IdeSourceSnippetContext *context,
                                    const gchar *key,
                                    const gchar *value);

### ide_source_snippet_context_add_shared_variable ()

    void
    ide_source_snippet_context_add_shared_variable
                                   (IdeSourceSnippetContext *context,
                                    const gchar *key,
                                    const gchar *value);

### ide_source_snippet_context_get_variable ()

    const gchar *
    ide_source_snippet_context_get_variable
                                   (IdeSourceSnippetContext *context,
                                    const gchar *key);

### ide_source_snippet_context_expand ()

    gchar *
    ide_source_snippet_context_expand (IdeSourceSnippetContext *context,
                                       const gchar *input);

### ide_source_snippet_context_set_tab_width ()

    void
    ide_source_snippet_context_set_tab_width
                                   (IdeSourceSnippetContext *context,
                                    gint tab_size);

### ide_source_snippet_context_set_use_spaces ()

    void
    ide_source_snippet_context_set_use_spaces
                                   (IdeSourceSnippetContext *context,
                                    gboolean use_spaces);

### ide_source_snippet_context_set_line_prefix ()

    void
    ide_source_snippet_context_set_line_prefix
                                   (IdeSourceSnippetContext *context,
                                    const gchar *line_prefix);

### ide_source_snippet_context_dump ()

    void
    ide_source_snippet_context_dump (IdeSourceSnippetContext *context);

## Types and Values

### IDE_TYPE_SOURCE_SNIPPET_CONTEXT

    #define IDE_TYPE_SOURCE_SNIPPET_CONTEXT (ide_source_snippet_context_get_type())

### IdeSourceSnippetContext

    typedef struct _IdeSourceSnippetContext IdeSourceSnippetContext;

## Signal Details

### The `“changed”` signal

    void
    user_function (IdeSourceSnippetContext *idesourcesnippetcontext,
                   gpointer                 user_data)

Flags: Run First