diff options
author | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2015-05-08 15:48:17 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2015-06-10 10:15:40 +0000 |
commit | 23b8a3b2e83e46e9ca8b1e7e314fad7030b23ff4 (patch) | |
tree | bf30a066c35c2df4385ff3cd08a9b683e216269b /src/plugins/clangcodemodel/clangeditordocumentparser.cpp | |
parent | 264132da27ce9a11ca102ce7efaae13b9baaab6b (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 <marco.bubke@theqtcompany.com>
Diffstat (limited to 'src/plugins/clangcodemodel/clangeditordocumentparser.cpp')
-rw-r--r-- | src/plugins/clangcodemodel/clangeditordocumentparser.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/clangcodemodel/clangeditordocumentparser.cpp b/src/plugins/clangcodemodel/clangeditordocumentparser.cpp index 004004c10ae..e12833ca9a1 100644 --- a/src/plugins/clangcodemodel/clangeditordocumentparser.cpp +++ b/src/plugins/clangcodemodel/clangeditordocumentparser.cpp @@ -46,7 +46,9 @@ static Q_LOGGING_CATEGORY(log, "qtc.clangcodemodel.clangeditordocumentparser") namespace { -QStringList createOptions(const QString &filePath, const CppTools::ProjectPart::Ptr &part) +QStringList createOptions(const QString &filePath, + const CppTools::ProjectPart::Ptr &part, + bool includeSpellCheck = false) { using namespace ClangCodeModel; @@ -54,7 +56,9 @@ QStringList createOptions(const QString &filePath, const CppTools::ProjectPart:: if (part.isNull()) return options; - options += QLatin1String("-fspell-checking"); + if (includeSpellCheck) + options += QLatin1String("-fspell-checking"); + options += ClangCodeModel::Utils::createClangOptions(part, filePath); if (Internal::PchInfo::Ptr pchInfo = Internal::PchManager::instance()->pchInfo(part)) @@ -91,7 +95,7 @@ void ClangEditorDocumentParser::update(CppTools::WorkingCopy workingCopy) QMutexLocker lock2(&m_mutex); updateProjectPart(); - const QStringList options = createOptions(filePath(), projectPart()); + const QStringList options = createOptions(filePath(), projectPart(), true); qCDebug(log, "Reparse options (cmd line equivalent): %s", commandLine(options, filePath()).toUtf8().constData()); |