aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangcodemodel/test
diff options
context:
space:
mode:
authorChristian Kandeler <[email protected]>2024-03-01 13:43:27 +0100
committerChristian Kandeler <[email protected]>2024-03-04 10:36:53 +0000
commitf56fd04c8dbbfead7800a1612fb0d1fd05ceeca6 (patch)
tree394396912519f8f50ec3d84c0f0cbf465232d723 /src/plugins/clangcodemodel/test
parentcf8a8974eda296ba82925bb3f2c0d2cfa1a4bc1b (diff)
Revert "Clangd: Avoid client restart after modifying open documents"
The whole point of tracking external changes to files is to use the open files as a sentinel to indicate that non-open files (on which we don't have a watch) have likely also been changed. This reverts commit cff26d813a8805c34588536ca19453852b946643. Change-Id: I5a8b3e6709eda881b912916cf0838b45d1ff4fa4 Reviewed-by: David Schulz <[email protected]> Reviewed-by: <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
Diffstat (limited to 'src/plugins/clangcodemodel/test')
-rw-r--r--src/plugins/clangcodemodel/test/clangdtests.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/clangcodemodel/test/clangdtests.cpp b/src/plugins/clangcodemodel/test/clangdtests.cpp
index 1edec4c2905..bfe7ea95368 100644
--- a/src/plugins/clangcodemodel/test/clangdtests.cpp
+++ b/src/plugins/clangcodemodel/test/clangdtests.cpp
@@ -2207,15 +2207,21 @@ void ClangdTestExternalChanges::test()
QVERIFY(curDoc->marks().isEmpty());
// Now trigger an external change in an open, but not currently visible file and
- // verify that we get diagnostics in the current editor.
+ // verify that we get a new client and diagnostics in the current editor.
TextDocument * const docToChange = document("mainwindow.cpp");
docToChange->setSilentReload();
QFile otherSource(filePath("mainwindow.cpp").toString());
QVERIFY(otherSource.open(QIODevice::WriteOnly));
otherSource.write("blubb");
otherSource.close();
+ QVERIFY(waitForSignalOrTimeout(LanguageClientManager::instance(),
+ &LanguageClientManager::clientAdded, timeOutInMs()));
+ ClangdClient * const newClient = ClangModelManagerSupport::clientForProject(project());
+ QVERIFY(newClient);
+ QVERIFY(newClient != oldClient);
+ newClient->enableTesting();
if (curDoc->marks().isEmpty())
- QVERIFY(waitForSignalOrTimeout(client(), &ClangdClient::textMarkCreated, timeOutInMs()));
+ QVERIFY(waitForSignalOrTimeout(newClient, &ClangdClient::textMarkCreated, timeOutInMs()));
}