forked from qt-creator/qt-creator
Clang: Don't analyze same file multiple times
Diagnostics do not depend much on project parts. But having the same file twice can result in duplicated diagnostics which later can cause the same fix-it being applied twice and getting corrupted code. Change-Id: Ie2809af7a54034b05df9383875f7c3123aea58e8 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -155,7 +155,7 @@ public:
|
||||
return false;
|
||||
|
||||
if (!node->isDir)
|
||||
result += static_cast<TreeWithFileInfo *>(node)->info;
|
||||
result.push_back(static_cast<TreeWithFileInfo *>(node)->info);
|
||||
|
||||
return true;
|
||||
});
|
||||
@@ -194,7 +194,7 @@ private:
|
||||
Tree *projectDirTree = buildProjectDirTree(project->projectDirectory(),
|
||||
fileInfos,
|
||||
outOfBaseDirFiles);
|
||||
if (outOfBaseDirFiles.isEmpty()) {
|
||||
if (outOfBaseDirFiles.empty()) {
|
||||
// Showing the project file and beneath the project dir is pointless in this case,
|
||||
// so get rid of the root node and modify the project dir node as the new root node.
|
||||
projectDirTree->name = m_root->name;
|
||||
@@ -229,7 +229,7 @@ private:
|
||||
|
||||
for (const FileInfo &fileInfo : fileInfos) {
|
||||
if (!fileInfo.file.isChildOf(projectDirNode->fullPath)) {
|
||||
outOfBaseDirFiles += fileInfo;
|
||||
outOfBaseDirFiles.push_back(fileInfo);
|
||||
continue; // Handle these separately.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user