Clang: Add Symbol Indexing

It is a first step and now a database is generated if you start QtCreator.
Some code is now shared with the PchManager which can be improved in the
future.

Change-Id: Ic267fe7960f6c455d91832859a673ce98f269aa2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2017-08-17 12:44:52 +02:00
parent 8488ce627b
commit 3adb71d45e
65 changed files with 1195 additions and 175 deletions

View File

@@ -26,14 +26,19 @@
#include <QCommandLineParser>
#include <QCoreApplication>
#include <QLoggingCategory>
#include <QDir>
#include <connectionserver.h>
#include <stringcache.h>
#include <refactoringserver.h>
#include <refactoringclientproxy.h>
#include <symbolindexing.h>
using ClangBackEnd::FilePathCache;
using ClangBackEnd::RefactoringClientProxy;
using ClangBackEnd::RefactoringServer;
using ClangBackEnd::ConnectionServer;
using ClangBackEnd::SymbolIndexing;
QString processArguments(QCoreApplication &application)
{
@@ -52,7 +57,7 @@ QString processArguments(QCoreApplication &application)
}
int main(int argc, char *argv[])
{
try {
//QLoggingCategory::setFilterRules(QStringLiteral("*.debug=false"));
QCoreApplication::setOrganizationName(QStringLiteral("QtProject"));
@@ -64,13 +69,17 @@ int main(int argc, char *argv[])
const QString connection = processArguments(application);
RefactoringServer clangCodeModelServer;
FilePathCache<std::mutex> filePathCache;
SymbolIndexing symbolIndexing{filePathCache, Utils::PathString{QDir::tempPath() + "/symbol.db"}};
RefactoringServer clangCodeModelServer{symbolIndexing, filePathCache};
ConnectionServer<RefactoringServer, RefactoringClientProxy> connectionServer(connection);
connectionServer.start();
connectionServer.setServer(&clangCodeModelServer);
return application.exec();
} catch (const Sqlite::SqliteException &exception) {
exception.printWarning();
}