forked from qt-creator/qt-creator
TextEditor: move rename symbol action to text editor
Task-number: QTCREATORBUG-21578 Change-Id: I9a873dcd38bacb2287c45973b6be0091c3eb9480 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -844,7 +844,7 @@ void QmlJSEditorWidget::findUsages()
|
||||
m_findReferences->findUsages(textDocument()->filePath().toString(), textCursor().position());
|
||||
}
|
||||
|
||||
void QmlJSEditorWidget::renameUsages()
|
||||
void QmlJSEditorWidget::renameSymbolUnderCursor()
|
||||
{
|
||||
m_findReferences->renameUsages(textDocument()->filePath().toString(), textCursor().position());
|
||||
}
|
||||
@@ -1098,9 +1098,10 @@ QmlJSEditorFactory::QmlJSEditorFactory(Core::Id _id)
|
||||
setCompletionAssistProvider(new QmlJSCompletionAssistProvider);
|
||||
|
||||
setEditorActionHandlers(TextEditorActionHandler::Format
|
||||
| TextEditorActionHandler::UnCommentSelection
|
||||
| TextEditorActionHandler::UnCollapseAll
|
||||
| TextEditorActionHandler::FollowSymbolUnderCursor);
|
||||
| TextEditorActionHandler::UnCommentSelection
|
||||
| TextEditorActionHandler::UnCollapseAll
|
||||
| TextEditorActionHandler::FollowSymbolUnderCursor
|
||||
| TextEditorActionHandler::RenameSymbol);
|
||||
}
|
||||
|
||||
void QmlJSEditorFactory::decorateEditor(TextEditorWidget *editor)
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
void inspectElementUnderCursor() const;
|
||||
|
||||
void findUsages() override;
|
||||
void renameUsages();
|
||||
void renameSymbolUnderCursor() override;
|
||||
void showContextPane();
|
||||
|
||||
signals:
|
||||
|
||||
@@ -162,10 +162,7 @@ QmlJSEditorPluginPrivate::QmlJSEditorPluginPrivate()
|
||||
contextMenu->addAction(cmd);
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
QAction *renameUsagesAction = new QAction(QmlJSEditorPlugin::tr("Rename Symbol Under Cursor"), this);
|
||||
cmd = ActionManager::registerAction(renameUsagesAction, "QmlJSEditor.RenameUsages", context);
|
||||
cmd->setDefaultKeySequence(QKeySequence(QmlJSEditorPlugin::tr("Ctrl+Shift+R")));
|
||||
connect(renameUsagesAction, &QAction::triggered, this, &QmlJSEditorPluginPrivate::renameUsages);
|
||||
cmd = ActionManager::command(TextEditor::Constants::RENAME_SYMBOL);
|
||||
contextMenu->addAction(cmd);
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
@@ -247,7 +244,7 @@ QuickToolBar *QmlJSEditorPlugin::quickToolBar()
|
||||
void QmlJSEditorPluginPrivate::renameUsages()
|
||||
{
|
||||
if (auto editor = qobject_cast<QmlJSEditorWidget*>(EditorManager::currentEditor()->widget()))
|
||||
editor->renameUsages();
|
||||
editor->renameSymbolUnderCursor();
|
||||
}
|
||||
|
||||
void QmlJSEditorPluginPrivate::reformatFile()
|
||||
|
||||
Reference in New Issue
Block a user