IdeCompletionItem: Builder SDK Reference

## IdeCompletionItem IdeCompletionItem |

## Functions

#define | IDE_COMPLETION_ITEM_CONST()
IdeCompletionItem * | ide_completion_item_new ()
gboolean | ide_completion_item_match ()
void | ide_completion_item_set_priority ()
gboolean | ide_completion_item_fuzzy_match ()
gchar * | ide_completion_item_fuzzy_highlight ()

## Object Hierarchy

        GObject
        ╰── IdeCompletionItem

## Description

## Functions

### IDE_COMPLETION_ITEM_CONST()

    #define IDE_COMPLETION_ITEM_CONST(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj), IDE_TYPE_COMPLETION_ITEM, IdeCompletionItem const))

### ide_completion_item_new ()

    IdeCompletionItem *
    ide_completion_item_new (void);

### ide_completion_item_match ()

    gboolean
    ide_completion_item_match (IdeCompletionItem *self,
                               const gchar *query,
                               const gchar *casefold);

### ide_completion_item_set_priority ()

    void
    ide_completion_item_set_priority (IdeCompletionItem *self,
                                      guint priority);

### ide_completion_item_fuzzy_match ()

    gboolean
    ide_completion_item_fuzzy_match (const gchar *haystack,
                                     const gchar *casefold_needle,
                                     guint *priority);

This helper function can do a fuzzy match for you giving a haystack and casefolded needle. Casefold your needle using `g_utf8_casefold()` before running the query against a batch of IdeCompletionItem for the best performance.

score will be set with the score of the match upon success. Otherwise, it will be set to zero.

#### Parameters

haystack | the string to be searched. |
casefold_needle | A `g_utf8_casefold()` version of the needle. |
priority | An optional location for the score of the match. | [out][allow-none]

#### Returns

`TRUE` if `haystack` matched `casefold_needle` , otherwise `FALSE`.

### ide_completion_item_fuzzy_highlight ()

    gchar *
    ide_completion_item_fuzzy_highlight (const gchar *haystack,
                                         const gchar *casefold_query);

## Types and Values