[gnome-builder/gnome-builder-43] plugins/codeui: add back support for renaming symbols
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-43] plugins/codeui: add back support for renaming symbols
- Date: Wed, 21 Sep 2022 00:26:14 +0000 (UTC)
commit a060434eb42734fbbb52b2018c5cb25cde17bd08
Author: Christian Hergert <chergert redhat com>
Date: Tue Sep 20 17:20:27 2022 -0700
plugins/codeui: add back support for renaming symbols
This was missing from the IdeSourceView port, and it is a bit nicer to
keep it out of IdeSourceView anyway.
Long term, it would be nice to have a refactory dialog so that we can
show the upcoming text edits before applying them.
Fixes #1695
po/POTFILES.in | 4 +
src/libide/sourceview/gtk/menus.ui | 1 +
src/plugins/codeui/codeui-plugin.c | 5 +
src/plugins/codeui/codeui.gresource.xml | 2 +
src/plugins/codeui/gbp-codeui-editor-page-addin.c | 206 ++++++++++++++++++++++
src/plugins/codeui/gbp-codeui-editor-page-addin.h | 31 ++++
src/plugins/codeui/gbp-codeui-rename-dialog.c | 183 +++++++++++++++++++
src/plugins/codeui/gbp-codeui-rename-dialog.h | 37 ++++
src/plugins/codeui/gbp-codeui-rename-dialog.ui | 37 ++++
src/plugins/codeui/gtk/menus.ui | 10 ++
src/plugins/codeui/meson.build | 2 +
11 files changed, 518 insertions(+)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 2c6ce7764..f27d85066 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -129,7 +129,11 @@ src/plugins/code-index/gbp-code-index-application-addin.c
src/plugins/code-index/gbp-code-index-service.c
src/plugins/code-index/ide-code-index-index.c
src/plugins/codespell/ide-codespell-diagnostic-provider.c
+src/plugins/codeui/gbp-codeui-editor-page-addin.c
src/plugins/codeui/gbp-codeui-hover-provider.c
+src/plugins/codeui/gbp-codeui-rename-dialog.c
+src/plugins/codeui/gbp-codeui-rename-dialog.ui
+src/plugins/codeui/gtk/menus.ui
src/plugins/comment-code/gtk/menus.ui
src/plugins/copyright/org.gnome.builder.copyright.gschema.xml
src/plugins/copyright/tweaks.ui
diff --git a/src/libide/sourceview/gtk/menus.ui b/src/libide/sourceview/gtk/menus.ui
index 95e9b3548..aaba9325e 100644
--- a/src/libide/sourceview/gtk/menus.ui
+++ b/src/libide/sourceview/gtk/menus.ui
@@ -157,6 +157,7 @@
<attribute name="action">sourceview.find-references</attribute>
</item>
</section>
+ <section id="ide-source-view-popup-menu-foundry-section"/>
<section id="ide-source-view-popup-menu-files-section"/>
</menu>
</interface>
diff --git a/src/plugins/codeui/codeui-plugin.c b/src/plugins/codeui/codeui-plugin.c
index d0237be13..aa2a59eaf 100644
--- a/src/plugins/codeui/codeui-plugin.c
+++ b/src/plugins/codeui/codeui-plugin.c
@@ -23,10 +23,12 @@
#include <libpeas/peas.h>
#include <libide-code.h>
+#include <libide-editor.h>
#include <libide-sourceview.h>
#include <libide-tree.h>
#include "gbp-codeui-buffer-addin.h"
+#include "gbp-codeui-editor-page-addin.h"
#include "gbp-codeui-hover-provider.h"
#include "gbp-codeui-tree-addin.h"
@@ -36,6 +38,9 @@ _gbp_codeui_register_types (PeasObjectModule *module)
peas_object_module_register_extension_type (module,
IDE_TYPE_BUFFER_ADDIN,
GBP_TYPE_CODEUI_BUFFER_ADDIN);
+ peas_object_module_register_extension_type (module,
+ IDE_TYPE_EDITOR_PAGE_ADDIN,
+ GBP_TYPE_CODEUI_EDITOR_PAGE_ADDIN);
peas_object_module_register_extension_type (module,
GTK_SOURCE_TYPE_HOVER_PROVIDER,
GBP_TYPE_CODEUI_HOVER_PROVIDER);
diff --git a/src/plugins/codeui/codeui.gresource.xml b/src/plugins/codeui/codeui.gresource.xml
index e0733b815..32f4c9aac 100644
--- a/src/plugins/codeui/codeui.gresource.xml
+++ b/src/plugins/codeui/codeui.gresource.xml
@@ -2,5 +2,7 @@
<gresources>
<gresource prefix="/plugins/codeui">
<file>codeui.plugin</file>
+ <file preprocess="xml-stripblanks">gbp-codeui-rename-dialog.ui</file>
+ <file preprocess="xml-stripblanks">gtk/menus.ui</file>
</gresource>
</gresources>
diff --git a/src/plugins/codeui/gbp-codeui-editor-page-addin.c
b/src/plugins/codeui/gbp-codeui-editor-page-addin.c
new file mode 100644
index 000000000..f61d60f5f
--- /dev/null
+++ b/src/plugins/codeui/gbp-codeui-editor-page-addin.c
@@ -0,0 +1,206 @@
+/* gbp-codeui-editor-page-addin.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-codeui-editor-page-addin"
+
+#include "config.h"
+
+#include <glib/gi18n.h>
+
+#include <libide-editor.h>
+
+#include "gbp-codeui-editor-page-addin.h"
+#include "gbp-codeui-rename-dialog.h"
+
+struct _GbpCodeuiEditorPageAddin
+{
+ GObject parent_instance;
+
+ IdeEditorPage *page;
+
+ IdeBuffer *buffer;
+ gulong notify_rename_provider;
+ gulong notify_has_selection;
+};
+
+static void rename_symbol_action (GbpCodeuiEditorPageAddin *self,
+ GVariant *params);
+
+IDE_DEFINE_ACTION_GROUP (GbpCodeuiEditorPageAddin, gbp_codeui_editor_page_addin, {
+ { "rename-symbol", rename_symbol_action },
+})
+
+static void
+gbp_codeui_editor_page_addin_update_state (GbpCodeuiEditorPageAddin *self)
+{
+ IdeRenameProvider *provider;
+ gboolean has_selection;
+
+ IDE_ENTRY;
+
+ g_assert (IDE_IS_MAIN_THREAD ());
+ g_assert (GBP_IS_CODEUI_EDITOR_PAGE_ADDIN (self));
+ g_assert (IDE_IS_BUFFER (self->buffer));
+
+ provider = ide_buffer_get_rename_provider (self->buffer);
+ has_selection = gtk_text_buffer_get_has_selection (GTK_TEXT_BUFFER (self->buffer));
+
+ gbp_codeui_editor_page_addin_set_action_enabled (self, "rename-symbol", has_selection && provider);
+
+ IDE_EXIT;
+}
+
+static void
+gbp_codeui_editor_page_addin_load (IdeEditorPageAddin *addin,
+ IdeEditorPage *page)
+{
+ GbpCodeuiEditorPageAddin *self = (GbpCodeuiEditorPageAddin *)addin;
+
+ IDE_ENTRY;
+
+ g_assert (GBP_IS_CODEUI_EDITOR_PAGE_ADDIN (self));
+ g_assert (IDE_IS_EDITOR_PAGE (page));
+
+ self->page = page;
+ self->buffer = g_object_ref (ide_editor_page_get_buffer (page));
+
+ self->notify_rename_provider =
+ g_signal_connect_object (self->buffer,
+ "notify::rename-provider",
+ G_CALLBACK (gbp_codeui_editor_page_addin_update_state),
+ self,
+ G_CONNECT_SWAPPED);
+
+ self->notify_has_selection =
+ g_signal_connect_object (self->buffer,
+ "notify::has-selection",
+ G_CALLBACK (gbp_codeui_editor_page_addin_update_state),
+ self,
+ G_CONNECT_SWAPPED);
+
+ gbp_codeui_editor_page_addin_update_state (self);
+
+ IDE_EXIT;
+}
+
+static void
+gbp_codeui_editor_page_addin_unload (IdeEditorPageAddin *addin,
+ IdeEditorPage *page)
+{
+ GbpCodeuiEditorPageAddin *self = (GbpCodeuiEditorPageAddin *)addin;
+
+ IDE_ENTRY;
+
+ g_assert (GBP_IS_CODEUI_EDITOR_PAGE_ADDIN (self));
+ g_assert (IDE_IS_EDITOR_PAGE (page));
+
+ g_clear_signal_handler (&self->notify_has_selection, self->buffer);
+ g_clear_signal_handler (&self->notify_rename_provider, self->buffer);
+
+ g_clear_object (&self->buffer);
+
+ self->page = NULL;
+
+ IDE_EXIT;
+}
+
+static void
+editor_page_addin_iface_init (IdeEditorPageAddinInterface *iface)
+{
+ iface->load = gbp_codeui_editor_page_addin_load;
+ iface->unload = gbp_codeui_editor_page_addin_unload;
+}
+
+static void
+rename_symbol_action (GbpCodeuiEditorPageAddin *self,
+ GVariant *param)
+{
+ g_autoptr(IdeLocation) location = NULL;
+ IdeRenameProvider *provider;
+ GtkTextBuffer *buffer;
+ GtkTextIter begin, end;
+ GtkWidget *dialog;
+ g_autofree char *word = NULL;
+ gboolean failed = FALSE;
+
+ IDE_ENTRY;
+
+ g_assert (IDE_IS_MAIN_THREAD ());
+ g_assert (GBP_IS_CODEUI_EDITOR_PAGE_ADDIN (self));
+ g_assert (IDE_IS_BUFFER (self->buffer));
+
+ if (!(provider = ide_buffer_get_rename_provider (self->buffer)))
+ IDE_EXIT;
+
+ buffer = GTK_TEXT_BUFFER (self->buffer);
+
+ if (!gtk_text_buffer_get_selection_bounds (buffer, &begin, &end))
+ IDE_EXIT;
+
+ gtk_text_iter_order (&begin, &end);
+
+ for (GtkTextIter iter = begin;
+ gtk_text_iter_compare (&iter, &end) < 0;
+ gtk_text_iter_forward_char (&iter))
+ {
+ gunichar ch = gtk_text_iter_get_char (&iter);
+
+ if (g_unichar_isspace (ch))
+ {
+ failed = TRUE;
+ break;
+ }
+ }
+
+ if (failed)
+ {
+ GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (self->page)));
+
+ dialog = adw_message_dialog_new (toplevel,
+ _("Symbol Not Selected"),
+ _("A symbol to rename must be selected"));
+ adw_message_dialog_add_response (ADW_MESSAGE_DIALOG (dialog), "close", _("Close"));
+ gtk_window_present (GTK_WINDOW (dialog));
+
+ IDE_EXIT;
+ }
+
+ word = gtk_text_iter_get_slice (&begin, &end);
+ location = ide_buffer_get_iter_location (self->buffer, &begin);
+
+ dialog = gbp_codeui_rename_dialog_new (provider, location, word);
+ gtk_window_present (GTK_WINDOW (dialog));
+
+ IDE_EXIT;
+}
+
+G_DEFINE_FINAL_TYPE_WITH_CODE (GbpCodeuiEditorPageAddin, gbp_codeui_editor_page_addin, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_GROUP,
gbp_codeui_editor_page_addin_init_action_group)
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_EDITOR_PAGE_ADDIN,
editor_page_addin_iface_init))
+
+static void
+gbp_codeui_editor_page_addin_class_init (GbpCodeuiEditorPageAddinClass *klass)
+{
+}
+
+static void
+gbp_codeui_editor_page_addin_init (GbpCodeuiEditorPageAddin *self)
+{
+}
diff --git a/src/plugins/codeui/gbp-codeui-editor-page-addin.h
b/src/plugins/codeui/gbp-codeui-editor-page-addin.h
new file mode 100644
index 000000000..51758fb5b
--- /dev/null
+++ b/src/plugins/codeui/gbp-codeui-editor-page-addin.h
@@ -0,0 +1,31 @@
+/* gbp-codeui-editor-page-addin.h
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define GBP_TYPE_CODEUI_EDITOR_PAGE_ADDIN (gbp_codeui_editor_page_addin_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpCodeuiEditorPageAddin, gbp_codeui_editor_page_addin, GBP, CODEUI_EDITOR_PAGE_ADDIN,
GObject)
+
+G_END_DECLS
diff --git a/src/plugins/codeui/gbp-codeui-rename-dialog.c b/src/plugins/codeui/gbp-codeui-rename-dialog.c
new file mode 100644
index 000000000..70c12643f
--- /dev/null
+++ b/src/plugins/codeui/gbp-codeui-rename-dialog.c
@@ -0,0 +1,183 @@
+/* gbp-codeui-rename-dialog.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-codeui-rename-dialog"
+
+#include "config.h"
+
+#include <glib/gi18n.h>
+
+#include <libide-code.h>
+
+#include "gbp-codeui-rename-dialog.h"
+
+struct _GbpCodeuiRenameDialog
+{
+ AdwMessageDialog parent_instance;
+
+ AdwEntryRow *old_symbol;
+ AdwEntryRow *new_symbol;
+
+ IdeLocation *location;
+ IdeRenameProvider *provider;
+ char *word;
+};
+
+G_DEFINE_FINAL_TYPE (GbpCodeuiRenameDialog, gbp_codeui_rename_dialog, ADW_TYPE_MESSAGE_DIALOG)
+
+static void
+gbp_codeui_rename_dialog_notify_text_cb (GbpCodeuiRenameDialog *self,
+ GParamSpec *pspec,
+ GtkEditable *editable)
+{
+ const char *str;
+ gboolean enabled;
+
+ g_assert (GBP_IS_CODEUI_RENAME_DIALOG (self));
+ g_assert (GTK_IS_EDITABLE (editable));
+
+ str = gtk_editable_get_text (editable);
+ enabled = !ide_str_empty0 (str);
+
+ for (const char *iter = str;
+ enabled && *iter;
+ iter = g_utf8_next_char (iter))
+ {
+ gunichar ch = g_utf8_get_char (iter);
+
+ if (g_unichar_isspace (ch))
+ enabled = FALSE;
+ }
+
+ adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG (self), "rename", enabled);
+}
+
+static void
+get_edits_cb (GObject *object,
+ GAsyncResult *result,
+ gpointer user_data)
+{
+ IdeRenameProvider *provider = (IdeRenameProvider *)object;
+ g_autoptr(GbpCodeuiRenameDialog) self = user_data;
+ g_autoptr(GPtrArray) text_edits = NULL;
+ g_autoptr(GError) error = NULL;
+ IdeBufferManager *buffer_manager;
+ IdeContext *context;
+
+ IDE_ENTRY;
+
+ g_assert (IDE_IS_MAIN_THREAD ());
+ g_assert (IDE_IS_RENAME_PROVIDER (provider));
+ g_assert (G_IS_ASYNC_RESULT (result));
+ g_assert (GBP_IS_CODEUI_RENAME_DIALOG (self));
+
+ /* Get the edits to apply. It would be nice someday to show these
+ * to the user interactively with a "refactory" dialog.
+ */
+ if (!ide_rename_provider_rename_finish (provider, result, &text_edits, &error))
+ {
+ ide_object_warning (IDE_OBJECT (provider),
+ _("Failed to rename symbol: %s"),
+ error->message);
+ IDE_EXIT;
+ }
+
+ IDE_PTR_ARRAY_SET_FREE_FUNC (text_edits, g_object_unref);
+
+ /* If we fail to get a context, we must have shutdown */
+ if (!(context = ide_object_get_context (IDE_OBJECT (provider))))
+ IDE_EXIT;
+
+ /* Apply the edits via the buffer manager */
+ buffer_manager = ide_buffer_manager_from_context (context);
+ ide_buffer_manager_apply_edits_async (buffer_manager,
+ g_steal_pointer (&text_edits),
+ NULL, NULL, NULL);
+
+ IDE_EXIT;
+}
+
+static void
+gbp_codeui_rename_dialog_rename_cb (GbpCodeuiRenameDialog *self)
+{
+ g_assert (IDE_IS_MAIN_THREAD ());
+ g_assert (GBP_IS_CODEUI_RENAME_DIALOG (self));
+ g_assert (IDE_IS_LOCATION (self->location));
+ g_assert (IDE_IS_RENAME_PROVIDER (self->provider));
+
+ ide_rename_provider_rename_async (self->provider,
+ self->location,
+ gtk_editable_get_text (GTK_EDITABLE (self->new_symbol)),
+ NULL,
+ get_edits_cb,
+ g_object_ref (self));
+}
+
+static void
+gbp_codeui_rename_dialog_dispose (GObject *object)
+{
+ GbpCodeuiRenameDialog *self = (GbpCodeuiRenameDialog *)object;
+
+ g_clear_object (&self->location);
+ g_clear_object (&self->provider);
+ g_clear_pointer (&self->word, g_free);
+
+ G_OBJECT_CLASS (gbp_codeui_rename_dialog_parent_class)->dispose (object);
+}
+
+static void
+gbp_codeui_rename_dialog_class_init (GbpCodeuiRenameDialogClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ object_class->dispose = gbp_codeui_rename_dialog_dispose;
+
+ gtk_widget_class_set_template_from_resource (widget_class, "/plugins/codeui/gbp-codeui-rename-dialog.ui");
+ gtk_widget_class_bind_template_child (widget_class, GbpCodeuiRenameDialog, old_symbol);
+ gtk_widget_class_bind_template_child (widget_class, GbpCodeuiRenameDialog, new_symbol);
+ gtk_widget_class_bind_template_callback (widget_class, gbp_codeui_rename_dialog_rename_cb);
+ gtk_widget_class_bind_template_callback (widget_class, gbp_codeui_rename_dialog_notify_text_cb);
+}
+
+static void
+gbp_codeui_rename_dialog_init (GbpCodeuiRenameDialog *self)
+{
+ gtk_widget_init_template (GTK_WIDGET (self));
+}
+
+GtkWidget *
+gbp_codeui_rename_dialog_new (IdeRenameProvider *provider,
+ IdeLocation *location,
+ const char *word)
+{
+ GbpCodeuiRenameDialog *self;
+
+ self = g_object_new (GBP_TYPE_CODEUI_RENAME_DIALOG, NULL);
+ self->provider = g_object_ref (provider);
+ self->location = g_object_ref (location);
+ self->word = g_strdup (word);
+
+ gtk_editable_set_text (GTK_EDITABLE (self->old_symbol), word);
+ gtk_editable_set_text (GTK_EDITABLE (self->new_symbol), word);
+ gtk_widget_grab_focus (GTK_WIDGET (self->new_symbol));
+
+ return GTK_WIDGET (self);
+}
diff --git a/src/plugins/codeui/gbp-codeui-rename-dialog.h b/src/plugins/codeui/gbp-codeui-rename-dialog.h
new file mode 100644
index 000000000..38448b99a
--- /dev/null
+++ b/src/plugins/codeui/gbp-codeui-rename-dialog.h
@@ -0,0 +1,37 @@
+/* gbp-codeui-rename-dialog.h
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <adwaita.h>
+
+#include <libide-code.h>
+
+G_BEGIN_DECLS
+
+#define GBP_TYPE_CODEUI_RENAME_DIALOG (gbp_codeui_rename_dialog_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpCodeuiRenameDialog, gbp_codeui_rename_dialog, GBP, CODEUI_RENAME_DIALOG,
AdwMessageDialog)
+
+GtkWidget *gbp_codeui_rename_dialog_new (IdeRenameProvider *provider,
+ IdeLocation *location,
+ const char *word);
+
+G_END_DECLS
diff --git a/src/plugins/codeui/gbp-codeui-rename-dialog.ui b/src/plugins/codeui/gbp-codeui-rename-dialog.ui
new file mode 100644
index 000000000..786be2220
--- /dev/null
+++ b/src/plugins/codeui/gbp-codeui-rename-dialog.ui
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <template class="GbpCodeuiRenameDialog" parent="AdwMessageDialog">
+ <property name="heading" translatable="yes">Rename Symbol</property>
+ <property name="default-response">rename</property>
+ <property name="close-response">close</property>
+ <signal name="response::rename" handler="gbp_codeui_rename_dialog_rename_cb"/>
+ <responses>
+ <response id="close" translatable="yes">_Cancel</response>
+ <response id="rename" translatable="yes" appearance="destructive">_Rename</response>
+ </responses>
+ <property name="extra-child">
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="margin-top">18</property>
+ <property name="width-request">375</property>
+ <property name="spacing">18</property>
+ <child>
+ <object class="AdwPreferencesGroup">
+ <child>
+ <object class="AdwEntryRow" id="old_symbol">
+ <property name="title" translatable="yes">Current Symbol name</property>
+ <property name="editable">false</property>
+ </object>
+ </child>
+ <child>
+ <object class="AdwEntryRow" id="new_symbol">
+ <property name="title" translatable="yes">New Symbol name</property>
+ <signal name="notify::text" handler="gbp_codeui_rename_dialog_notify_text_cb" swapped="true"
object="GbpCodeuiRenameDialog"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </property>
+ </template>
+</interface>
diff --git a/src/plugins/codeui/gtk/menus.ui b/src/plugins/codeui/gtk/menus.ui
new file mode 100644
index 000000000..732026eb9
--- /dev/null
+++ b/src/plugins/codeui/gtk/menus.ui
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <menu id="ide-source-view-popup-menu-foundry-section">
+ <item>
+ <attribute name="id">codeui-rename-symbol</attribute>
+ <attribute name="label" translatable="yes">R_ename Symbol…</attribute>
+ <attribute name="action">page.codeui.rename-symbol</attribute>
+ </item>
+ </menu>
+</interface>
diff --git a/src/plugins/codeui/meson.build b/src/plugins/codeui/meson.build
index f13c5c37c..13b9c353d 100644
--- a/src/plugins/codeui/meson.build
+++ b/src/plugins/codeui/meson.build
@@ -1,7 +1,9 @@
plugins_sources += files([
'codeui-plugin.c',
'gbp-codeui-buffer-addin.c',
+ 'gbp-codeui-editor-page-addin.c',
'gbp-codeui-hover-provider.c',
+ 'gbp-codeui-rename-dialog.c',
'gbp-codeui-tree-addin.c',
])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]