summaryrefslogtreecommitdiff
path: root/src/plugins/clangrefactoring
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/clangrefactoring')
-rw-r--r--src/plugins/clangrefactoring/clangrefactoring-source.pri6
-rw-r--r--src/plugins/clangrefactoring/clangrefactoring_dependencies.pri3
-rw-r--r--src/plugins/clangrefactoring/clangrefactoringplugin.cpp6
-rw-r--r--src/plugins/clangrefactoring/refactoringprojectupdater.cpp37
-rw-r--r--src/plugins/clangrefactoring/refactoringprojectupdater.h41
-rw-r--r--src/plugins/clangrefactoring/sourcelocations.h7
6 files changed, 97 insertions, 3 deletions
diff --git a/src/plugins/clangrefactoring/clangrefactoring-source.pri b/src/plugins/clangrefactoring/clangrefactoring-source.pri
index 24102dfd99..b08d292190 100644
--- a/src/plugins/clangrefactoring/clangrefactoring-source.pri
+++ b/src/plugins/clangrefactoring/clangrefactoring-source.pri
@@ -11,7 +11,8 @@ HEADERS += \
$$PWD/clangqueryexamplehighlightmarker.h \
$$PWD/clangqueryhighlightmarker.h \
$$PWD/clangqueryexamplehighlighter.h \
- $$PWD/clangqueryhighlighter.h
+ $$PWD/clangqueryhighlighter.h \
+ $$PWD/refactoringprojectupdater.h
SOURCES += \
$$PWD/refactoringengine.cpp \
@@ -22,4 +23,5 @@ SOURCES += \
$$PWD/projectpartutilities.cpp \
$$PWD/clangqueryprojectsfindfilter.cpp \
$$PWD/clangqueryexamplehighlighter.cpp \
- $$PWD/clangqueryhighlighter.cpp
+ $$PWD/clangqueryhighlighter.cpp \
+ $$PWD/refactoringprojectupdater.cpp
diff --git a/src/plugins/clangrefactoring/clangrefactoring_dependencies.pri b/src/plugins/clangrefactoring/clangrefactoring_dependencies.pri
index ed775ae4fc..8a08236177 100644
--- a/src/plugins/clangrefactoring/clangrefactoring_dependencies.pri
+++ b/src/plugins/clangrefactoring/clangrefactoring_dependencies.pri
@@ -5,4 +5,5 @@ QTC_LIB_DEPENDS += \
QTC_PLUGIN_DEPENDS += \
coreplugin \
cpptools \
- texteditor
+ texteditor \
+ clangpchmanager
diff --git a/src/plugins/clangrefactoring/clangrefactoringplugin.cpp b/src/plugins/clangrefactoring/clangrefactoringplugin.cpp
index 921cc24005..ea17409fac 100644
--- a/src/plugins/clangrefactoring/clangrefactoringplugin.cpp
+++ b/src/plugins/clangrefactoring/clangrefactoringplugin.cpp
@@ -25,6 +25,8 @@
#include "clangrefactoringplugin.h"
+#include <clangpchmanager/qtcreatorprojectupdater.h>
+
#include <cpptools/cppmodelmanager.h>
#include <coreplugin/icore.h>
@@ -50,6 +52,7 @@ std::unique_ptr<ClangRefactoringPluginData> ClangRefactoringPlugin::d;
class ClangRefactoringPluginData
{
+ using ProjectUpdater = ClangPchManager::QtCreatorProjectUpdater<ClangPchManager::ProjectUpdater>;
public:
RefactoringClient refactoringClient;
ClangBackEnd::RefactoringConnectionClient connectionClient{&refactoringClient};
@@ -58,6 +61,9 @@ public:
QtCreatorClangQueryFindFilter qtCreatorfindFilter{connectionClient.serverProxy(),
qtCreatorSearch,
refactoringClient};
+ ProjectUpdater projectUpdate{connectionClient.serverProxy()};
+
+
};
ClangRefactoringPlugin::ClangRefactoringPlugin()
diff --git a/src/plugins/clangrefactoring/refactoringprojectupdater.cpp b/src/plugins/clangrefactoring/refactoringprojectupdater.cpp
new file mode 100644
index 0000000000..07a9e97163
--- /dev/null
+++ b/src/plugins/clangrefactoring/refactoringprojectupdater.cpp
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#include "refactoringprojectupdater.h"
+
+namespace ClangRefactoring {
+
+RefactoringProjectUpdater::RefactoringProjectUpdater(ClangBackEnd::ProjectManagementServerInterface &server,
+ RefactoringClient &)
+ : ClangPchManager::ProjectUpdater(server)
+{
+
+}
+
+} // namespace ClangRefactoring
diff --git a/src/plugins/clangrefactoring/refactoringprojectupdater.h b/src/plugins/clangrefactoring/refactoringprojectupdater.h
new file mode 100644
index 0000000000..3debed0c4d
--- /dev/null
+++ b/src/plugins/clangrefactoring/refactoringprojectupdater.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#pragma once
+
+#include <clangpchmanager/projectupdater.h>
+
+namespace ClangRefactoring {
+
+class RefactoringClient;
+
+class RefactoringProjectUpdater : public ClangPchManager::ProjectUpdater
+{
+public:
+ RefactoringProjectUpdater(ClangBackEnd::ProjectManagementServerInterface &server,
+ RefactoringClient &client);
+};
+
+} // namespace ClangRefactoring
diff --git a/src/plugins/clangrefactoring/sourcelocations.h b/src/plugins/clangrefactoring/sourcelocations.h
index e4cb1df450..fe2d3dace9 100644
--- a/src/plugins/clangrefactoring/sourcelocations.h
+++ b/src/plugins/clangrefactoring/sourcelocations.h
@@ -50,6 +50,13 @@ public:
Utils::PathString sourcePath;
};
+ enum LocationGetter
+ {
+ SourceId = 0,
+ Line,
+ Column
+ };
+
std::vector<Location> locations;
std::unordered_map<qint64, Utils::PathString> sources;
};