IdeRenameProvider

IdeRenameProvider

Functions

Types and Values

Object Hierarchy

    GInterface
    ╰── IdeRenameProvider

Prerequisites

IdeRenameProvider requires IdeObject.

Known Implementations

IdeRenameProvider is implemented by IdeLspRenameProvider.

Description

Functions

ide_rename_provider_load ()

void
ide_rename_provider_load (IdeRenameProvider *self);

ide_rename_provider_unload ()

void
ide_rename_provider_unload (IdeRenameProvider *self);

ide_rename_provider_rename_async ()

void
ide_rename_provider_rename_async (IdeRenameProvider *self,
                                  IdeLocation *location,
                                  const gchar *new_name,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

This requests the provider to determine the edits that must be made to the project to perform the renaming of a symbol found at location .

Use ide_rename_provider_rename_finish() to get the results.

Parameters

self

An IdeRenameProvider

 

location

An IdeLocation

 

new_name

The replacement name for the symbol

 

cancellable

a GCancellable or NULL.

[nullable]

callback

a callback to complete the request

 

user_data

user data for callback

 

Since: 3.32


ide_rename_provider_rename_finish ()

gboolean
ide_rename_provider_rename_finish (IdeRenameProvider *self,
                                   GAsyncResult *result,
                                   GPtrArray **edits,
                                   GError **error);

Completes a request to ide_rename_provider_rename_async().

You can use the resulting GPtrArray of IdeTextEdit instances to edit the project to complete the symbol rename.

Parameters

self

An IdeRenameProvider

 

result

a GAsyncResult

 

edits

A location for a GPtrArray of IdeTextEdit instances.

[out][transfer full][element-type IdeTextEdit][optional]

error

a location for a GError, or NULL.

 

Returns

TRUE if successful and edits is set. Otherwise FALSE and error is set.

Since: 3.32

Types and Values

IDE_TYPE_RENAME_PROVIDER

#define IDE_TYPE_RENAME_PROVIDER (ide_rename_provider_get_type())

struct IdeRenameProviderInterface

struct IdeRenameProviderInterface {
  GTypeInterface parent_iface;

  void     (*load)          (IdeRenameProvider    *self);
  void     (*unload)        (IdeRenameProvider    *self);
  void     (*rename_async)  (IdeRenameProvider    *self,
                             IdeLocation          *location,
                             const gchar          *new_name,
                             GCancellable         *cancellable,
                             GAsyncReadyCallback   callback,
                             gpointer              user_data);
  gboolean (*rename_finish) (IdeRenameProvider    *self,
                             GAsyncResult         *result,
                             GPtrArray           **edits,
                             GError              **error);
};

IdeRenameProvider

typedef struct _IdeRenameProvider IdeRenameProvider;