Clang: Use current TranslationUnit follow symbol based on clang code model

It might be quite a safe replacement which can fix builtin
code model issues.

If clang code model fails to follow symbol or does not find
a definition when it's required we fall back to the built-in
code model to proceed with project-wide follow symbol.

To make it almost a full replacement tweak include paths underline
on cursor hover to match what we have in built-in code model.

SIGNAL/SLOTS macros are not yet supported but can be handled
in follow up patch.

Task-number: QTCREATORBUG-19477
Change-Id: Id1611511d661a8aaf3e93502b4e03e1792c7c1d3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-01-05 10:50:37 +01:00
parent 388713df12
commit 7b2774dea1
5 changed files with 79 additions and 25 deletions

View File

@@ -261,6 +261,7 @@ void ClangCodeModelServer::requestDocumentAnnotations(const RequestDocumentAnnot
DocumentProcessor processor = documentProcessors().processor(document);
processor.addJob(JobRequest::Type::RequestDocumentAnnotations);
processor.addJob(JobRequest::Type::UpdateExtraDocumentAnnotations);
processor.process();
} catch (const std::exception &exception) {
qWarning() << "Error in ClangCodeModelServer::requestDocumentAnnotations:" << exception.what();