diff options
Diffstat (limited to 'src/libs/cplusplus/CppDocument.cpp')
-rw-r--r-- | src/libs/cplusplus/CppDocument.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index ec617ff929..0d39e3b1db 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -198,6 +198,8 @@ protected: }; +#define DO_NOT_DUMP_ALL_PARSER_ERRORS + class DocumentDiagnosticClient : public DiagnosticClient { enum { MAX_MESSAGE_COUNT = 10 }; @@ -217,8 +219,10 @@ public: if (level == Error) { ++errorCount; +#ifdef DO_NOT_DUMP_ALL_PARSER_ERRORS if (errorCount >= MAX_MESSAGE_COUNT) return; // ignore the error +#endif // DO_NOT_DUMP_ALL_PARSER_ERRORS } const QString fileName = QString::fromUtf8(fileId->chars(), fileId->size()); @@ -229,6 +233,16 @@ public: QString message; message.vsprintf(format, ap); +#ifndef DO_NOT_DUMP_ALL_PARSER_ERRORS + { + const char *levelStr = "Unknown level"; + if (level == Document::DiagnosticMessage::Warning) levelStr = "Warning"; + if (level == Document::DiagnosticMessage::Error) levelStr = "Error"; + if (level == Document::DiagnosticMessage::Fatal) levelStr = "Fatal"; + qDebug("%s:%u:%u: %s: %s", fileId->chars(), line, column, levelStr, message.toUtf8().constData()); + } +#endif // DO_NOT_DUMP_ALL_PARSER_ERRORS + Document::DiagnosticMessage m(convertLevel(level), doc->fileName(), line, column, message); messages->append(m); @@ -341,10 +355,9 @@ void Document::appendMacro(const Macro ¯o) void Document::addMacroUse(const Macro ¯o, unsigned offset, unsigned length, unsigned beginLine, - const QVector<MacroArgumentReference> &actuals, bool inCondition) + const QVector<MacroArgumentReference> &actuals) { MacroUse use(macro, offset, offset + length, beginLine); - use.setInCondition(inCondition); foreach (const MacroArgumentReference &actual, actuals) { const Block arg(actual.position(), actual.position() + actual.length()); |