mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Merge pull request #3563 from laytan/fix-duplicate-suggestions
fix duplicate suggestions and add missing newline
This commit is contained in:
+1
-1
@@ -6201,7 +6201,7 @@ gb_internal bool evaluate_where_clauses(CheckerContext *ctx, Ast *call_expr, Sco
|
|||||||
error(c, "Prefer to separate 'where' clauses with a comma rather than '&&'");
|
error(c, "Prefer to separate 'where' clauses with a comma rather than '&&'");
|
||||||
gbString x = expr_to_string(c->BinaryExpr.left);
|
gbString x = expr_to_string(c->BinaryExpr.left);
|
||||||
gbString y = expr_to_string(c->BinaryExpr.right);
|
gbString y = expr_to_string(c->BinaryExpr.right);
|
||||||
error_line("\tSuggestion: '%s, %s'", x, y);
|
error_line("\tSuggestion: '%s, %s'\n", x, y);
|
||||||
gb_string_free(y);
|
gb_string_free(y);
|
||||||
gb_string_free(x);
|
gb_string_free(x);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-2
@@ -719,9 +719,13 @@ gb_internal void print_all_errors(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it.str.len-it.pos > 0) {
|
// Merge additional text (suggestions for example) into the previous error.
|
||||||
array_add_elems(&prev_ev->msg, it.str.text+it.pos, it.str.len-it.pos);
|
String current = {prev_ev->msg.data, prev_ev->msg.count};
|
||||||
|
String addition = {it.str.text+it.pos, it.str.len-it.pos};
|
||||||
|
if (addition.len > 0 && !string_contains_string(current, addition)) {
|
||||||
|
array_add_elems(&prev_ev->msg, addition.text, addition.len);
|
||||||
}
|
}
|
||||||
|
|
||||||
array_free(&ev.msg);
|
array_free(&ev.msg);
|
||||||
array_ordered_remove(&global_error_collector.error_values, i);
|
array_ordered_remove(&global_error_collector.error_values, i);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user