From 17d8b30e00cd6e4bcd1193edd326ec35dbe93332 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sun, 12 Apr 2015 23:06:28 +0100 Subject: [PATCH] syntax: Only display errors for current file Clang can report from various sources, only add those that are from the current file --- src/bin/editor/edi_editor.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bin/editor/edi_editor.c b/src/bin/editor/edi_editor.c index 9cad2d5..5993462 100644 --- a/src/bin/editor/edi_editor.c +++ b/src/bin/editor/edi_editor.c @@ -450,10 +450,16 @@ _clang_load_errors(const char *path EINA_UNUSED, Edi_Editor *editor) for(i = 0, n = clang_getNumDiagnostics(editor->tx_unit); i != n; ++i) { CXDiagnostic diag = clang_getDiagnostic(editor->tx_unit, i); + CXFile file; unsigned int line; + CXString path; // the parameter after line would be a caret position but we're just highlighting for now - clang_getSpellingLocation(clang_getDiagnosticLocation(diag), NULL, &line, NULL, NULL); + clang_getSpellingLocation(clang_getDiagnosticLocation(diag), &file, &line, NULL, NULL); + + path = clang_getFileName(file); + if (strcmp(elm_code_file_path_get(code->file), clang_getCString(path))) + continue; /* FIXME: Also handle ranges and fix suggestions. */ Elm_Code_Status_Type status = ELM_CODE_STATUS_TYPE_DEFAULT;