Clang: Request new diagnostics after reload

Diagnostics should be not computed after a file change but after creator
is requesting them. Now we wait for the dialog if the file should be
reloaded.

Change-Id: Id0d51874b95e0f8743002a91511d07e0ed47ecdc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-10-12 12:08:32 +02:00
parent b2713716b9
commit bc89baa6e8
3 changed files with 13 additions and 1 deletions

View File

@@ -459,6 +459,17 @@ void IpcCommunicator::requestDiagnostics(const FileContainer &fileContainer)
}
}
void IpcCommunicator::requestDiagnostics(Core::IDocument *document)
{
const auto textDocument = qobject_cast<TextDocument*>(document);
const auto filePath = textDocument->filePath().toString();
const QString projectPartId = Utils::projectPartIdForFile(filePath);
requestDiagnostics(FileContainer(filePath,
projectPartId,
textDocument->document()->revision()));
}
void IpcCommunicator::updateChangeContentStartPosition(const QString &filePath, int position)
{
auto *document = cppDocument(filePath);