forked from qt-creator/qt-creator
ClangUtils: Get rid of GenerateCompilationDbResult struct
Replace it with expected_str<FilePath>. Check periodically for cancel request inside generateCompilationDB() body. Cancel the possibly running task on ClangCodeModelPlugin destruction. Handle the cancellation. Change-Id: I8bcb956bc03627b4a17a3510a76810e66c82815d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -540,11 +540,15 @@ void ClangModelManagerSupport::updateLanguageClient(Project *project)
|
||||
generatorWatcher->deleteLater();
|
||||
if (!isProjectDataUpToDate(project, projectInfo, jsonDbDir))
|
||||
return;
|
||||
const GenerateCompilationDbResult result = generatorWatcher->result();
|
||||
if (!result.error.isEmpty()) {
|
||||
if (generatorWatcher->future().resultCount() == 0) {
|
||||
MessageManager::writeDisrupting(
|
||||
Tr::tr("Cannot use clangd: Failed to generate compilation database:\n%1")
|
||||
.arg(result.error));
|
||||
Tr::tr("Cannot use clangd: Generating compilation database canceled."));
|
||||
return;
|
||||
}
|
||||
const GenerateCompilationDbResult result = generatorWatcher->result();
|
||||
if (!result) {
|
||||
MessageManager::writeDisrupting(Tr::tr("Cannot use clangd: "
|
||||
"Failed to generate compilation database:\n%1").arg(result.error()));
|
||||
return;
|
||||
}
|
||||
Id previousId;
|
||||
|
||||
Reference in New Issue
Block a user