Browse Source

Add `"type"` field to `-json-errors`

gingerBill 1 year ago
parent
commit
16dc79fc5c
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/error.cpp

+ 8 - 0
src/error.cpp

@@ -667,6 +667,14 @@ gb_internal void print_all_errors(void) {
 
 			gb_fprintf(f, "\t\t{\n");
 
+			gb_fprintf(f, "\t\t\t\"type\": \"");
+			if (ev.kind == ErrorValue_Warning) {
+				gb_fprintf(f, "warning");
+			} else {
+				gb_fprintf(f, "error");
+			}
+			gb_fprintf(f, "\",\n");
+
 			gb_fprintf(f, "\t\t\t\"pos\": {\n");
 
 			if (ev.pos.file_id) {