aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangcodemodel/clangcodemodelplugin.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <[email protected]>2015-05-08 15:48:17 +0200
committerNikolai Kosjar <[email protected]>2015-06-10 10:15:40 +0000
commit23b8a3b2e83e46e9ca8b1e7e314fad7030b23ff4 (patch)
treebf30a066c35c2df4385ff3cd08a9b683e216269b /src/plugins/clangcodemodel/clangcodemodelplugin.cpp
parent264132da27ce9a11ca102ce7efaae13b9baaab6b (diff)
Clang: Use completion through backend process
This makes us independent of libclang crashes for completion. Re-parsing for highlighting still happens in the Qt Creator process. Run in verbose mode: qtc.clangcodemodel.ipc=true Run tests: -test "ClangCodeModel" Task-number: QTCREATORBUG-14108 Task-number: QTCREATORBUG-12819 Change-Id: Id3e95bd2afdb6508bbd1d35fddc69534a909b905 Reviewed-by: Marco Bubke <[email protected]>
Diffstat (limited to 'src/plugins/clangcodemodel/clangcodemodelplugin.cpp')
-rw-r--r--src/plugins/clangcodemodel/clangcodemodelplugin.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp
index 7028365e890..8f68803eb0c 100644
--- a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp
+++ b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp
@@ -34,6 +34,11 @@
#include "pchmanager.h"
#include "utils.h"
+#ifdef WITH_TESTS
+# include "test/clangcodecompletion_test.h"
+# include "test/clangcompletioncontextanalyzertest.h"
+#endif
+
#include <cpptools/cppmodelmanager.h>
#include <projectexplorer/projectpanelfactory.h>
@@ -73,9 +78,8 @@ bool ClangCodeModelPlugin::initialize(const QStringList &arguments, QString *err
connect(cppModelManager, &CppTools::CppModelManager::projectPartsUpdated,
pchManager, &PchManager::onProjectPartsUpdated);
- // Register ModelManagerSupport
- m_modelManagerSupport.reset(new ModelManagerSupport);
- cppModelManager->addModelManagerSupport(m_modelManagerSupport.data());
+ // Register ModelManagerSupportProvider
+ cppModelManager->addModelManagerSupportProvider(&m_modelManagerSupportProvider);
return true;
}
@@ -84,5 +88,16 @@ void ClangCodeModelPlugin::extensionsInitialized()
{
}
+#ifdef WITH_TESTS
+QList<QObject *> ClangCodeModelPlugin::createTestObjects() const
+{
+ return {
+ new Tests::ClangCodeCompletionTest,
+ new Tests::ClangCompletionContextAnalyzerTest
+ };
+}
+#endif
+
+
} // namespace Internal
} // namespace Clang