From b085ca7c0b5640c62b6f24f3f9b2351c29b85eb6 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Mon, 25 Nov 2013 13:33:49 -0800 Subject: [PATCH] Filtering out "too mary errors emitted" diags Because they're completely useless and incredibly annoying. --- python/ycm/completers/cpp/clang_completer.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/ycm/completers/cpp/clang_completer.py b/python/ycm/completers/cpp/clang_completer.py index 0a835dfa..3c203abb 100644 --- a/python/ycm/completers/cpp/clang_completer.py +++ b/python/ycm/completers/cpp/clang_completer.py @@ -36,6 +36,7 @@ FILE_TOO_SHORT_MESSAGE = ( MIN_LINES_IN_FILE_TO_PARSE ) ) NO_DIAGNOSTIC_MESSAGE = 'No diagnostic for current line!' PRAGMA_DIAG_TEXT_TO_IGNORE = '#pragma once in main file' +TOO_MANY_ERRORS_DIAG_TEXT_TO_IGNORE = 'too many errors emitted, stopping now' class ClangCompleter( Completer ): @@ -293,6 +294,11 @@ def _FilterDiagnostics( diagnostics ): # # See our issue #216 and upstream bug: # http://llvm.org/bugs/show_bug.cgi?id=16686 - return [ x for x in diagnostics if x.text_ != PRAGMA_DIAG_TEXT_TO_IGNORE ] + # + # The second thing we want to filter out are those incredibly annoying "too + # many errors emitted" diagnostics that are utterly useless. + return [ x for x in diagnostics if + x.text_ != PRAGMA_DIAG_TEXT_TO_IGNORE and + x.text_ != TOO_MANY_ERRORS_DIAG_TEXT_TO_IGNORE ]