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:
@@ -1,6 +1,8 @@
|
||||
#include "data/indexer/IndexerFactoryModuleJava.h"
|
||||
|
||||
#include "data/indexer/IndexerJava.h"
|
||||
#include "data/indexer/Indexer.h"
|
||||
#include "data/indexer/IndexerCommandJava.h"
|
||||
#include "data/parser/java/JavaParser.h"
|
||||
|
||||
IndexerFactoryModuleJava::~IndexerFactoryModuleJava()
|
||||
{
|
||||
@@ -8,5 +10,5 @@ IndexerFactoryModuleJava::~IndexerFactoryModuleJava()
|
||||
|
||||
std::shared_ptr<IndexerBase> IndexerFactoryModuleJava::createIndexer()
|
||||
{
|
||||
return std::make_shared<IndexerJava>();
|
||||
return std::make_shared<Indexer<IndexerCommandJava, JavaParser>>();
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#include "data/indexer/IndexerJava.h"
|
||||
|
||||
#include "data/parser/ParserClientImpl.h"
|
||||
#include "data/parser/java/JavaParser.h"
|
||||
#include "utility/file/FileRegister.h"
|
||||
|
||||
IndexerJava::IndexerJava()
|
||||
{
|
||||
}
|
||||
|
||||
IndexerJava::~IndexerJava()
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<IntermediateStorage> IndexerJava::index(std::shared_ptr<IndexerCommandJava> indexerCommand, std::shared_ptr<FileRegister> fileRegister)
|
||||
{
|
||||
std::shared_ptr<ParserClientImpl> parserClient = std::make_shared<ParserClientImpl>();
|
||||
std::shared_ptr<JavaParser> parser = std::make_shared<JavaParser>(parserClient);
|
||||
|
||||
std::shared_ptr<IntermediateStorage> storage = std::make_shared<IntermediateStorage>();
|
||||
parserClient->setStorage(storage);
|
||||
parserClient->startParsingFile();
|
||||
|
||||
fileRegister->markFileIndexing(indexerCommand->getSourceFilePath());
|
||||
parser->buildIndex(indexerCommand);
|
||||
fileRegister->markIndexingFilesIndexed();
|
||||
|
||||
parserClient->finishParsingFile();
|
||||
parserClient->resetStorage();
|
||||
|
||||
if (interrupted())
|
||||
{
|
||||
return std::shared_ptr<IntermediateStorage>();
|
||||
}
|
||||
|
||||
return storage;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#ifndef INDEXER_JAVA_H
|
||||
#define INDEXER_JAVA_H
|
||||
|
||||
#include "data/indexer/Indexer.h"
|
||||
#include "data/indexer/IndexerCommandJava.h"
|
||||
|
||||
class IndexerJava: public Indexer<IndexerCommandJava>
|
||||
{
|
||||
public:
|
||||
IndexerJava();
|
||||
virtual ~IndexerJava();
|
||||
|
||||
private:
|
||||
virtual std::shared_ptr<IntermediateStorage> index(std::shared_ptr<IndexerCommandJava> indexerCommand, std::shared_ptr<FileRegister> fileRegister);
|
||||
};
|
||||
|
||||
#endif // INDEXER_JAVA_H
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "utility/text/TextAccess.h"
|
||||
#include "utility/utilityString.h"
|
||||
|
||||
JavaParser::JavaParser(std::shared_ptr<ParserClient> client)
|
||||
JavaParser::JavaParser(std::shared_ptr<ParserClient> client, std::shared_ptr<FileRegister> fileRegister)
|
||||
: Parser(client)
|
||||
, m_id(s_nextParserId++)
|
||||
, m_currentFilePath("")
|
||||
|
||||
@@ -29,7 +29,7 @@ class FileRegister;
|
||||
class JavaParser: public Parser
|
||||
{
|
||||
public:
|
||||
JavaParser(std::shared_ptr<ParserClient> client);
|
||||
JavaParser(std::shared_ptr<ParserClient> client, std::shared_ptr<FileRegister> fileRegister);
|
||||
~JavaParser();
|
||||
|
||||
void buildIndex(std::shared_ptr<IndexerCommandJava> indexerCommand);
|
||||
@@ -168,7 +168,6 @@ private:
|
||||
void doRecordComment(jint beginLine, jint beginColumn, jint endLine, jint endColumn);
|
||||
void doRecordError(jstring jMessage, jint jFatal, jint jIndexed, jint beginLine, jint beginColumn, jint endLine, jint endColumn);
|
||||
|
||||
std::shared_ptr<FileRegister> m_fileRegister;
|
||||
std::shared_ptr<JavaEnvironment> m_javaEnvironment;
|
||||
|
||||
const int m_id;
|
||||
|
||||
Reference in New Issue
Block a user