## IAnjutaLanguageProvider IAnjutaLanguageProvider — Provider for autocompletion features |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libanjuta/interfaces/ianjuta-language-provider.h>

    #define             IANJUTA_LANGUAGE_PROVIDER_ERROR
    #define             IANJUTA_LANGUAGE_PROVIDER_PREF_CALLTIP_ENABLE
    #define             IANJUTA_LANGUAGE_PROVIDER_PREF_AUTOCOMPLETE_ENABLE
    #define             IANJUTA_LANGUAGE_PROVIDER_PREF_AUTOCOMPLETE_SPACE_AFTER_FUNC
    #define             IANJUTA_LANGUAGE_PROVIDER_PREF_AUTOCOMPLETE_BRACE_AFTER_FUNC
    #define             IANJUTA_LANGUAGE_PROVIDER_PREF_AUTOCOMPLETE_CLOSEBRACE_AFTER_FUNC
    struct              IAnjutaLanguageProviderIface;
    GQuark              ianjuta_language_provider_error_quark
                                                            (void);
    GList *             ianjuta_language_provider_get_calltip_cache
                                                            (IAnjutaLanguageProvider *obj,
                                                             gchar *call_context,
                                                             GError **err);
    gchar *             ianjuta_language_provider_get_calltip_context
                                                            (IAnjutaLanguageProvider *obj,
                                                             IAnjutaIterable *iter,
                                                             GError **err);
    void                ianjuta_language_provider_new_calltip
                                                            (IAnjutaLanguageProvider *obj,
                                                             gchar *call_context,
                                                             IAnjutaIterable *iter,
                                                             GError **err);
    IAnjutaIterable *   ianjuta_language_provider_populate_completions
                                                            (IAnjutaLanguageProvider *obj,
                                                             IAnjutaIterable *iter,
                                                             GError **err);

## Description

## Details

### IANJUTA_LANGUAGE_PROVIDER_ERROR

    #define IANJUTA_LANGUAGE_PROVIDER_ERROR ianjuta_language_provider_error_quark()

### IANJUTA_LANGUAGE_PROVIDER_PREF_CALLTIP_ENABLE

    #define IANJUTA_LANGUAGE_PROVIDER_PREF_CALLTIP_ENABLE "calltip-enable"

Boolean key, true is calltips has to be shown.

### IANJUTA_LANGUAGE_PROVIDER_PREF_AUTOCOMPLETE_ENABLE

    #define IANJUTA_LANGUAGE_PROVIDER_PREF_AUTOCOMPLETE_ENABLE "completion-enable"

Boolean key, true is code completion is enable.

### IANJUTA_LANGUAGE_PROVIDER_PREF_AUTOCOMPLETE_SPACE_AFTER_FUNC

    #define IANJUTA_LANGUAGE_PROVIDER_PREF_AUTOCOMPLETE_SPACE_AFTER_FUNC "completion-space-after-func"

Boolean key, true is adding a space after function call autocompletion

### IANJUTA_LANGUAGE_PROVIDER_PREF_AUTOCOMPLETE_BRACE_AFTER_FUNC

    #define IANJUTA_LANGUAGE_PROVIDER_PREF_AUTOCOMPLETE_BRACE_AFTER_FUNC "completion-brace-after-func"

Boolean key, true is adding '(' after function call autocompletion

### IANJUTA_LANGUAGE_PROVIDER_PREF_AUTOCOMPLETE_CLOSEBRACE_AFTER_FUNC

    #define IANJUTA_LANGUAGE_PROVIDER_PREF_AUTOCOMPLETE_CLOSEBRACE_AFTER_FUNC "completion-closebrace-after-func"

Boolean key, true is adding ')' after function call autocompletion

### struct IAnjutaLanguageProviderIface

    struct IAnjutaLanguageProviderIface {
    	IAnjutaProviderIface g_iface;

    	GList* (*get_calltip_cache) (IAnjutaLanguageProvider *obj, gchar* call_context, GError **err);
    	gchar* (*get_calltip_context) (IAnjutaLanguageProvider *obj, IAnjutaIterable* iter, GError **err);
    	void (*new_calltip) (IAnjutaLanguageProvider *obj, gchar* call_context,  IAnjutaIterable* iter, GError **err);
    	IAnjutaIterable* (*populate_completions) (IAnjutaLanguageProvider *obj, IAnjutaIterable* iter, GError **err);
    };

### ianjuta_language_provider_error_quark ()

    GQuark              ianjuta_language_provider_error_quark
                                                            (void);

### ianjuta_language_provider_get_calltip_cache ()

    GList *             ianjuta_language_provider_get_calltip_cache
                                                            (IAnjutaLanguageProvider *obj,
                                                             gchar *call_context,
                                                             GError **err);

Searches for a calltip in the cache

`obj` : | Self
`call_context` : | name of the method to show a calltip
`err` : | Error propagation
Returns : | tips for the searched name of the method from the cache, NULL if nothing found. [element-type utf8][transfer container]

### ianjuta_language_provider_get_calltip_context ()

    gchar *             ianjuta_language_provider_get_calltip_context
                                                            (IAnjutaLanguageProvider *obj,
                                                             IAnjutaIterable *iter,
                                                             GError **err);

Searches for a calltip context

`obj` : | Self
`iter` : | current cursor position
`err` : | Error propagation
Returns : | name of the method to show a calltip for or NULL

### ianjuta_language_provider_new_calltip ()

    void                ianjuta_language_provider_new_calltip
                                                            (IAnjutaLanguageProvider *obj,
                                                             gchar *call_context,
                                                             IAnjutaIterable *iter,
                                                             GError **err);

Creates a new calltip

`obj` : | Self
`call_context` : | name of the method to create a new calltip
`iter` : | current cursor position
`err` : | Error propagation

### ianjuta_language_provider_populate_completions ()

    IAnjutaIterable *   ianjuta_language_provider_populate_completions
                                                            (IAnjutaLanguageProvider *obj,
                                                             IAnjutaIterable *iter,
                                                             GError **err);

Show completion for the context at position `iter`. The provider should call ianjuta_editor_assist_proposals here to add proposals to the list.

Note that this is called after every character typed and the list of proposals has to be completely renewed.

`obj` : | Self
`iter` : | the text iter where the provider should be populated
`err` : | Error propagation and reporting.
Returns : | the iter where the provider populated, NULL otherwise. [transfer full][allow-none]