CppEditor: add default RefactoringEngine

..and use it when we don't have refactoring plug-in

Change-Id: Ibe317a9728d439b9c5e05271d92a330d22eaacb9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2017-08-03 14:13:42 +02:00
parent 62ada96091
commit 76d12dc2d5
14 changed files with 226 additions and 83 deletions

View File

@@ -25,18 +25,18 @@
#pragma once
#include "cursorineditor.h"
#include <utils/fileutils.h>
#include <clangsupport/sourcelocationscontainer.h>
#include <clangsupport/refactoringclientinterface.h>
QT_BEGIN_NAMESPACE
class QTextCursor;
QT_END_NAMESPACE
namespace TextEditor {
class TextEditorWidget;
} // namespace TextEditor
namespace CppTools {
class CppEditorWidget;
class ProjectPart;
enum class CallType
@@ -45,19 +45,17 @@ enum class CallType
Asynchronous
};
// NOTE: This interface is not supposed to be owned as an interface pointer
class RefactoringEngineInterface
{
public:
using RenameCallback = ClangBackEnd::RefactoringClientInterface::RenameCallback;
virtual void startLocalRenaming(const QTextCursor &textCursor,
const Utils::FileName &filePath,
int revision,
virtual void startLocalRenaming(const CursorInEditor &data,
CppTools::ProjectPart *projectPart,
RenameCallback &&renameSymbolsCallback) = 0;
virtual bool isUsable() const = 0;
};
} // namespace CppTools