logic: Hide non-fatal errors in unindexed files
* added database field indexed to error to tell if the error occured within an indexed file * added checkbox to Preferences for showing them
This commit is contained in:
@@ -21,7 +21,9 @@ public:
|
||||
std::vector<FilePath> systemHeaderSearchPaths;
|
||||
std::vector<FilePath> frameworkSearchPaths;
|
||||
std::vector<std::string> compilerFlags;
|
||||
|
||||
bool logErrors;
|
||||
|
||||
std::string language;
|
||||
std::string languageStandard;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
virtual void startParsingFile() = 0;
|
||||
virtual void finishParsingFile() = 0;
|
||||
|
||||
virtual void onError(const ParseLocation& location, const std::string& message, bool fatal) = 0;
|
||||
virtual void onError(const ParseLocation& location, const std::string& message, bool fatal, bool indexed) = 0;
|
||||
|
||||
virtual void onTypedefParsed(
|
||||
const ParseLocation& location, const NameHierarchy& typedefName, AccessType access, bool isImplicit) = 0;
|
||||
|
||||
@@ -34,7 +34,7 @@ void ParserClientImpl::finishParsingFile()
|
||||
{
|
||||
}
|
||||
|
||||
void ParserClientImpl::onError(const ParseLocation& location, const std::string& message, bool fatal)
|
||||
void ParserClientImpl::onError(const ParseLocation& location, const std::string& message, bool fatal, bool indexed)
|
||||
{
|
||||
log(std::string(fatal ? "FATAL: " : "ERROR: "), message, location);
|
||||
|
||||
@@ -43,7 +43,7 @@ void ParserClientImpl::onError(const ParseLocation& location, const std::string&
|
||||
return;
|
||||
}
|
||||
|
||||
addError(message, fatal, location);
|
||||
addError(message, fatal, indexed, location);
|
||||
}
|
||||
|
||||
void ParserClientImpl::onTypedefParsed(
|
||||
@@ -576,14 +576,14 @@ void ParserClientImpl::addCommentLocation(const ParseLocation& location)
|
||||
);
|
||||
}
|
||||
|
||||
void ParserClientImpl::addError(const std::string& message, bool fatal, const ParseLocation& location)
|
||||
void ParserClientImpl::addError(const std::string& message, bool fatal, bool indexed, const ParseLocation& location)
|
||||
{
|
||||
if (!m_storage)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_storage->addError(message, fatal, location.filePath.str(), location.startLineNumber, location.startColumnNumber);
|
||||
m_storage->addError(message, fatal, indexed, location.filePath.str(), location.startLineNumber, location.startColumnNumber);
|
||||
}
|
||||
|
||||
void ParserClientImpl::log(std::string type, std::string str, const ParseLocation& location) const
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
virtual void startParsingFile();
|
||||
virtual void finishParsingFile();
|
||||
|
||||
virtual void onError(const ParseLocation& location, const std::string& message, bool fatal);
|
||||
virtual void onError(const ParseLocation& location, const std::string& message, bool fatal, bool indexed);
|
||||
|
||||
virtual void onTypedefParsed(
|
||||
const ParseLocation& location, const NameHierarchy& typedefName, AccessType access, bool isImplicit);
|
||||
@@ -97,7 +97,7 @@ private:
|
||||
void addSourceLocation(Id elementId, const ParseLocation& location, int type);
|
||||
void addComponentAccess(Id nodeId , int type);
|
||||
void addCommentLocation(const ParseLocation& location);
|
||||
void addError(const std::string& message, bool fatal, const ParseLocation& location);
|
||||
void addError(const std::string& message, bool fatal, bool indexed, const ParseLocation& location);
|
||||
|
||||
void log(std::string type, std::string str, const ParseLocation& location) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user