From 28742774fecf696181c4b38e3dd5e52eb1311ce2 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 9 Aug 2023 15:17:28 +0200 Subject: [PATCH] TextEditor: add rename symbol option to editor context menu ... if the action handler supports the rename option. Change-Id: Ic1bad19a490aaccc8e96afd1f74741596bf6efc3 Reviewed-by: Friedemann Kleint Reviewed-by: Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 82948a8c16d..6cf2221da7b 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -8365,6 +8365,11 @@ void TextEditorWidget::appendStandardContextMenuActions(QMenu *menu) if (!menu->actions().contains(findUsage)) menu->addAction(findUsage); } + if (optionalActions() & TextEditorActionHandler::RenameSymbol) { + const auto renameSymbol = ActionManager::command(Constants::RENAME_SYMBOL)->action(); + if (!menu->actions().contains(renameSymbol)) + menu->addAction(renameSymbol); + } if (optionalActions() & TextEditorActionHandler::CallHierarchy) { const auto callHierarchy = ActionManager::command(Constants::OPEN_CALL_HIERARCHY)->action(); if (!menu->actions().contains(callHierarchy))