data: stop indexing of files with fatal errors and store them as incomplete (issue 358)

* avoid AST traversial for CXX translation units with fatal errors
* save all files within those translation units as incomplete
* show number of complete files in finished indexing dialog and overview stats
* display incomplete files hatched in graph view
* display incomplete file titles hatched in code view
* mention file incompleteness in tooltips
* removed derived Indexer classes and set ParserType via template parameter instead
* moved getSourceFileFromCDB from IndexerCxxCdb to IndexerCommandCxxCdb

bug id = 358
This commit is contained in:
Eberhard Graether
2017-04-15 01:02:09 +02:00
parent 2b38e0f45e
commit 8dc5ac7cbe
72 changed files with 399 additions and 375 deletions
@@ -113,7 +113,7 @@ SourceLocationFile* SourceLocationCollection::createSourceLocationFile(const Fil
return file;
}
std::shared_ptr<SourceLocationFile> filePtr = std::make_shared<SourceLocationFile>(filePath, false);
std::shared_ptr<SourceLocationFile> filePtr = std::make_shared<SourceLocationFile>(filePath, false, false);
m_files.emplace(filePath, filePtr);
return filePtr.get();
}
+14 -3
View File
@@ -1,8 +1,9 @@
#include "data/location/SourceLocationFile.h"
SourceLocationFile::SourceLocationFile(const FilePath& filePath, bool isWhole)
SourceLocationFile::SourceLocationFile(const FilePath& filePath, bool isWhole, bool isComplete)
: m_filePath(filePath)
, m_isWhole(isWhole)
, m_isComplete(isComplete)
{
}
@@ -25,6 +26,16 @@ bool SourceLocationFile::isWhole() const
return m_isWhole;
}
void SourceLocationFile::setIsComplete(bool isComplete)
{
m_isComplete = isComplete;
}
bool SourceLocationFile::isComplete() const
{
return m_isComplete;
}
const std::multiset<std::shared_ptr<SourceLocation>, SourceLocationFile::LocationComp>& SourceLocationFile::getSourceLocations() const
{
return m_locations;
@@ -141,7 +152,7 @@ void SourceLocationFile::forEachEndSourceLocation(std::function<void(SourceLocat
std::shared_ptr<SourceLocationFile> SourceLocationFile::getFilteredByLines(size_t firstLineNumber, size_t lastLineNumber) const
{
std::shared_ptr<SourceLocationFile> ret = std::make_shared<SourceLocationFile>(getFilePath(), false);
std::shared_ptr<SourceLocationFile> ret = std::make_shared<SourceLocationFile>(getFilePath(), false, isComplete());
for (std::shared_ptr<SourceLocation> location : m_locations)
{
@@ -156,7 +167,7 @@ std::shared_ptr<SourceLocationFile> SourceLocationFile::getFilteredByLines(size_
std::shared_ptr<SourceLocationFile> SourceLocationFile::getFilteredByType(LocationType type) const
{
std::shared_ptr<SourceLocationFile> ret = std::make_shared<SourceLocationFile>(getFilePath(), false);
std::shared_ptr<SourceLocationFile> ret = std::make_shared<SourceLocationFile>(getFilePath(), false, isComplete());
for (std::shared_ptr<SourceLocation> location : m_locations)
{
+5 -1
View File
@@ -21,7 +21,7 @@ public:
}
};
SourceLocationFile(const FilePath& filePath, bool isWhole);
SourceLocationFile(const FilePath& filePath, bool isWhole, bool isComplete);
virtual ~SourceLocationFile();
const FilePath& getFilePath() const;
@@ -29,6 +29,9 @@ public:
void setIsWhole(bool isWhole);
bool isWhole() const;
void setIsComplete(bool isComplete);
bool isComplete() const;
const std::multiset<std::shared_ptr<SourceLocation>, LocationComp>& getSourceLocations() const;
size_t getSourceLocationCount() const;
@@ -52,6 +55,7 @@ public:
private:
const FilePath m_filePath;
bool m_isWhole;
bool m_isComplete;
std::multiset<std::shared_ptr<SourceLocation>, LocationComp> m_locations;
std::map<Id, SourceLocation*> m_locationIndex;