forked from enlightenment/edi
syntax: Only display errors for current file
Clang can report from various sources, only add those that are from the current file
This commit is contained in:
parent
bc6ec2dd6f
commit
17d8b30e00
|
@ -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)
|
for(i = 0, n = clang_getNumDiagnostics(editor->tx_unit); i != n; ++i)
|
||||||
{
|
{
|
||||||
CXDiagnostic diag = clang_getDiagnostic(editor->tx_unit, i);
|
CXDiagnostic diag = clang_getDiagnostic(editor->tx_unit, i);
|
||||||
|
CXFile file;
|
||||||
unsigned int line;
|
unsigned int line;
|
||||||
|
CXString path;
|
||||||
|
|
||||||
// the parameter after line would be a caret position but we're just highlighting for now
|
// 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. */
|
/* FIXME: Also handle ranges and fix suggestions. */
|
||||||
Elm_Code_Status_Type status = ELM_CODE_STATUS_TYPE_DEFAULT;
|
Elm_Code_Status_Type status = ELM_CODE_STATUS_TYPE_DEFAULT;
|
||||||
|
|
Loading…
Reference in New Issue