CppEditor: Make sure fallback project part is up to date

... with regards to the session include paths.
Amends 0636238429.

Fixes: QTCREATORBUG-26323
Change-Id: I8e2cd5f5e87d9dc3d2df3f943e13599bc7139768
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-10-15 14:42:17 +02:00
parent fc11797218
commit 8c86b9bca1
2 changed files with 4 additions and 4 deletions

View File

@@ -483,10 +483,6 @@ void ClangModelManagerSupport::onEditorOpened(Core::IEditor *editor)
// TODO: Ensure that not fully loaded documents are updated?
// TODO: If the file does not belong to any project and it is a header file,
// it might make sense to check whether the file is included by any file
// that does belong to a project, and if so, use the respective client
// instead. Is this feasible?
ProjectExplorer::Project * const project
= ProjectExplorer::SessionManager::projectForFile(document->filePath());
if (ClangdClient * const client = clientForProject(project))

View File

@@ -694,6 +694,10 @@ CppModelManager::CppModelManager()
connect(KitManager::instance(), &KitManager::kitsChanged, this,
&CppModelManager::setupFallbackProjectPart);
connect(this, &CppModelManager::projectPartsRemoved, this,
&CppModelManager::setupFallbackProjectPart);
connect(this, &CppModelManager::projectPartsUpdated, this,
&CppModelManager::setupFallbackProjectPart);
setupFallbackProjectPart();
qRegisterMetaType<CPlusPlus::Document::Ptr>("CPlusPlus::Document::Ptr");