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:
@@ -72,9 +72,25 @@ std::string ParserClient::addLocationSuffix(
|
||||
}
|
||||
|
||||
ParserClient::ParserClient()
|
||||
: m_hasFatalErrors(false)
|
||||
{
|
||||
}
|
||||
|
||||
ParserClient::~ParserClient()
|
||||
{
|
||||
}
|
||||
|
||||
void ParserClient::onErrorParsed(const ParseLocation& location, const std::string& message, bool fatal, bool indexed)
|
||||
{
|
||||
this->onError(location, message, fatal, indexed);
|
||||
|
||||
if (fatal)
|
||||
{
|
||||
m_hasFatalErrors = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool ParserClient::hasFatalErrors() const
|
||||
{
|
||||
return m_hasFatalErrors;
|
||||
}
|
||||
|
||||
@@ -28,9 +28,6 @@ public:
|
||||
ParserClient();
|
||||
virtual ~ParserClient();
|
||||
|
||||
virtual void startParsingFile() = 0;
|
||||
virtual void finishParsingFile() = 0;
|
||||
|
||||
virtual Id recordSymbol(
|
||||
const NameHierarchy& symbolName, SymbolKind symbolKind,
|
||||
AccessKind access, DefinitionKind definitionKind) = 0;
|
||||
@@ -53,6 +50,13 @@ public:
|
||||
virtual void onLocalSymbolParsed(const std::string& name, const ParseLocation& location) = 0;
|
||||
virtual void onFileParsed(const FileInfo& fileInfo) = 0;
|
||||
virtual void onCommentParsed(const ParseLocation& location) = 0;
|
||||
|
||||
void onErrorParsed(const ParseLocation& location, const std::string& message, bool fatal, bool indexed);
|
||||
|
||||
bool hasFatalErrors() const;
|
||||
|
||||
protected:
|
||||
bool m_hasFatalErrors;
|
||||
};
|
||||
|
||||
#endif // PARSER_CLIENT_H
|
||||
|
||||
@@ -18,19 +18,15 @@ ParserClientImpl::~ParserClientImpl()
|
||||
void ParserClientImpl::setStorage(std::shared_ptr<IntermediateStorage> storage)
|
||||
{
|
||||
m_storage = storage;
|
||||
|
||||
m_hasFatalErrors = 0;
|
||||
}
|
||||
|
||||
void ParserClientImpl::resetStorage()
|
||||
{
|
||||
m_storage.reset();
|
||||
}
|
||||
|
||||
void ParserClientImpl::startParsingFile()
|
||||
{
|
||||
}
|
||||
|
||||
void ParserClientImpl::finishParsingFile()
|
||||
{
|
||||
m_hasFatalErrors = 0;
|
||||
}
|
||||
|
||||
Id ParserClientImpl::recordSymbol(
|
||||
@@ -236,7 +232,7 @@ void ParserClientImpl::addFile(Id id, const FilePath& filePath, const std::strin
|
||||
return;
|
||||
}
|
||||
|
||||
m_storage->addFile(id, filePath.str(), modificationTime);
|
||||
m_storage->addFile(id, filePath.str(), modificationTime, true);
|
||||
}
|
||||
|
||||
void ParserClientImpl::addSymbol(Id id, DefinitionKind definitionKind)
|
||||
|
||||
@@ -19,9 +19,6 @@ public:
|
||||
void setStorage(std::shared_ptr<IntermediateStorage> storage);
|
||||
void resetStorage();
|
||||
|
||||
virtual void startParsingFile();
|
||||
virtual void finishParsingFile();
|
||||
|
||||
virtual Id recordSymbol(
|
||||
const NameHierarchy& symbolName, SymbolKind symbolKind,
|
||||
AccessKind access, DefinitionKind definitionKind);
|
||||
|
||||
Reference in New Issue
Block a user