ide-completion: Builder SDK Reference

## ide-completion ide-completion |

## Functions

IdeCompletionDisplay * | ide_completion_get_display ()
GtkSourceView * | ide_completion_get_view ()
GtkTextBuffer * | ide_completion_get_buffer ()
void | ide_completion_block_interactive ()
void | ide_completion_unblock_interactive ()
void | ide_completion_add_provider ()
void | ide_completion_remove_provider ()
guint | ide_completion_get_n_rows ()
void | ide_completion_set_n_rows ()
void | ide_completion_hide ()
void | ide_completion_show ()
void | ide_completion_cancel ()
gboolean | ide_completion_is_visible ()
void | ide_completion_move_cursor ()
gboolean | ide_completion_fuzzy_match ()
gchar * | ide_completion_fuzzy_highlight ()

## Properties

GtkTextView * | buffer | Read
guint | n-rows | Read / Write
GtkSourceView * | view | Read / Write / Construct Only

## Signals

void | hide | Action
void | provider-added | Run Last
void | provider-removed | Run Last
void | show | Action

## Types and Values

#define | IDE_TYPE_COMPLETION
| IdeCompletion

## Object Hierarchy

        GObject
        ╰── IdeCompletion

## Description

## Functions

### ide_completion_get_display ()

    IdeCompletionDisplay *
    ide_completion_get_display (IdeCompletion *self);

Gets the display for completion.

#### Parameters

self | a IdeCompletion |

#### Returns

an IdeCompletionDisplay.

[transfer none]

Since: 3.32

### ide_completion_get_view ()

    GtkSourceView *
    ide_completion_get_view (IdeCompletion *self);

#### Parameters

self | a IdeCompletion |

#### Returns

an GtkSourceView.

[transfer none]

Since: 3.32

### ide_completion_get_buffer ()

    GtkTextBuffer *
    ide_completion_get_buffer (IdeCompletion *self);

#### Parameters

self | a IdeCompletion |

#### Returns

a GtkTextBuffer.

[transfer none]

Since: 3.32

### ide_completion_block_interactive ()

    void
    ide_completion_block_interactive (IdeCompletion *self);

### ide_completion_unblock_interactive ()

    void
    ide_completion_unblock_interactive (IdeCompletion *self);

### ide_completion_add_provider ()

    void
    ide_completion_add_provider (IdeCompletion *self,
                                 IdeCompletionProvider *provider);

Adds an IdeCompletionProvider to the list of providers to be queried for completion results.

#### Parameters

self | an IdeCompletion |
provider | an IdeCompletionProvider |

Since: 3.32

### ide_completion_remove_provider ()

    void
    ide_completion_remove_provider (IdeCompletion *self,
                                    IdeCompletionProvider *provider);

Removes an IdeCompletionProvider previously added with `ide_completion_add_provider()`.

#### Parameters

self | an IdeCompletion |
provider | an IdeCompletionProvider |

Since: 3.32

### ide_completion_get_n_rows ()

    guint
    ide_completion_get_n_rows (IdeCompletion *self);

### ide_completion_set_n_rows ()

    void
    ide_completion_set_n_rows (IdeCompletion *self,
                               guint n_rows);

### ide_completion_hide ()

    void
    ide_completion_hide (IdeCompletion *self);

Emits the "hide" signal.

When the "hide" signal is emitted, the completion window will be dismissed.

#### Parameters

self | an IdeCompletion |

Since: 3.32

### ide_completion_show ()

    void
    ide_completion_show (IdeCompletion *self);

Emits the "show" signal.

When the "show" signal is emitted, the completion window will be displayed if there are any results available.

#### Parameters

self | an IdeCompletion |

Since: 3.32

### ide_completion_cancel ()

    void
    ide_completion_cancel (IdeCompletion *self);

### ide_completion_is_visible ()

    gboolean
    ide_completion_is_visible (IdeCompletion *self);

Checks if the completion display is visible.

#### Parameters

self | a IdeCompletion |

#### Returns

`TRUE` if the display is visible

Since: 3.32

### ide_completion_move_cursor ()

    void
    ide_completion_move_cursor (IdeCompletion *self,
                                GtkMovementStep step,
                                gint direction);

### ide_completion_fuzzy_match ()

    gboolean
    ide_completion_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.

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. | [nullable]
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`.

Since: 3.32

### ide_completion_fuzzy_highlight ()

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

This will add <b> tags around matched characters in `haystack` based on `casefold_query` .

#### Parameters

haystack | the string to be highlighted |
casefold_query | the typed-text used to highlight `haystack` |

#### Returns

a newly allocated string

Since: 3.32

## Types and Values

### IDE_TYPE_COMPLETION

    #define IDE_TYPE_COMPLETION (ide_completion_get_type())

### IdeCompletion

    typedef struct _IdeCompletion IdeCompletion;

## Property Details

### The `“buffer”` property

      “buffer”                   GtkTextView *

The GtkTextBuffer for the “view”. This is a convenience property for providers.

Flags: Read

Since: 3.32

### The `“n-rows”` property

      “n-rows”                   guint

The number of rows to display to the user.

Flags: Read / Write

Allowed values: [1,32]

Default value: 5

Since: 3.32

### The `“view”` property

      “view”                     GtkSourceView *

The "view" property is the GtkTextView for which this IdeCompletion is providing completion features.

Flags: Read / Write / Construct Only

Since: 3.32

## Signal Details

### The `“hide”` signal

    void
    user_function (IdeCompletion *self,
                   gpointer       user_data)

The "hide" signal is emitted when the completion window should be hidden.

#### Parameters

self | an IdeCompletion |
user_data | user data set when the signal handler was connected. |

Flags: Action

Since: 3.32

### The `“provider-added”` signal

    void
    user_function (IdeCompletion         *self,
                   IdeCompletionProvider *provider,
                   gpointer               user_data)

The "provided-added" signal is emitted when a new provider is added to the completion.

#### Parameters

self | an ideCompletion |
provider | an IdeCompletionProvider |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.32

### The `“provider-removed”` signal

    void
    user_function (IdeCompletion         *self,
                   IdeCompletionProvider *provider,
                   gpointer               user_data)

The "provided-removed" signal is emitted when a provider has been removed from the completion.

#### Parameters

self | an ideCompletion |
provider | an IdeCompletionProvider |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.32

### The `“show”` signal

    void
    user_function (IdeCompletion *self,
                   gpointer       user_data)

The "show" signal is emitted when the completion window should be shown.

#### Parameters

self | an IdeCompletion |
user_data | user data set when the signal handler was connected. |

Flags: Action

Since: 3.32