forked from qt-creator/qt-creator
Clang: Fix sending (un)register translation unit
Handle the following use cases:
1. Editor is opened
--> Register file at backend.
2. Close editor for which a project part exists
--> Unregister file with project part.
3. Close editor for which no project part exists (anymore)
--> Unregister file with empty/default project part.
Change-Id: I2b253004a920cccef989876538ab552eacf6b45c
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
@@ -126,7 +126,7 @@ ProjectPart::Ptr BaseEditorDocumentParser::determineProjectPart(const QString &f
|
||||
CppModelManager *cmm = CppModelManager::instance();
|
||||
QList<ProjectPart::Ptr> projectParts = cmm->projectPart(filePath);
|
||||
if (projectParts.isEmpty()) {
|
||||
if (projectPart)
|
||||
if (projectPart && config.stickToPreviousProjectPart)
|
||||
// File is not directly part of any project, but we got one before. We will re-use it,
|
||||
// because re-calculating this can be expensive when the dependency table is big.
|
||||
return projectPart;
|
||||
|
||||
Reference in New Issue
Block a user