Clang: Take over jobs if document's project changes

On registerProjectPartsForEditor() we recreated the affected
DocumentProcessors, but did not take care of the jobs that were in the
queue, which effectively could led to lost jobs. Catch up on this.

Task-number: QTCREATORBUG-18856
Change-Id: I4184e5dc6480667953f2d2081ccf39a28c092186
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Nikolai Kosjar
2018-01-05 09:35:00 +01:00
parent dd06a4188d
commit 2d7f1d6c8c
16 changed files with 162 additions and 19 deletions

View File

@@ -406,6 +406,18 @@ TEST_F(ClangCodeModelServerSlowTest, TranslationUnitAfterUpdateNeedsReparse)
ASSERT_THAT(clangServer, HasDirtyDocument(filePathA, projectPartId, 1U, true, true));
}
TEST_F(ClangCodeModelServerSlowTest, TakeOverJobsOnProjectPartChange)
{
registerProjectAndFileAndWaitForFinished(filePathC, 2);
updateVisibilty(filePathB, filePathB); // Disable processing jobs
requestReferences();
expectReferences();
changeProjectPartArguments(); // Here we do not want to loose the RequestReferences job
updateVisibilty(filePathC, filePathC); // Enable processing jobs
}
void ClangCodeModelServer::SetUp()
{
clangServer.setClient(&mockClangCodeModelClient);