forked from qt-creator/qt-creator
ClangCodeModel: Use project-specific clangd client, if possible
If we open a file that does not belong to a currently open project, there is a good chance that the current project's parse context is a better fit for the file than the fallback client's. Fixes: QTCREATORBUG-26697 Change-Id: I6c17e275b047602c51364f3203b3f0a3e74a49fc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -2036,7 +2036,7 @@ void ClangdTestExternalChanges::test()
|
||||
QVERIFY(waitForSignalOrTimeout(ClangModelManagerSupport::instance(),
|
||||
&ClangModelManagerSupport::createdClient, timeOutInMs()));
|
||||
ClangdClient * const newClient = ClangModelManagerSupport::instance()
|
||||
->clientForFile(filePath("main.cpp"));
|
||||
->clientForProject(project());
|
||||
QVERIFY(newClient);
|
||||
QVERIFY(newClient != oldClient);
|
||||
newClient->enableTesting();
|
||||
|
||||
Reference in New Issue
Block a user