frontend: provide contextual source repair advice
This commit is contained in:
1 parent
008867fe48
commit
2c6c7a3dcd
37 files changed
+562
-24
No files matched your search
@@ -123,6 +123,7 @@ const Graph = struct {
|
||||
.span = .{ .start = failure.pos, .end = failure.pos, .file = source.file, .namespace = source.name },
|
||||
.message = try std.fmt.allocPrint(g.arena, "expected {s}", .{failure.expected}),
|
||||
.fields = try g.arena.dupe(lower.Problem.Field, &.{ .{ .name = "expected", .value = failure.expected }, .{ .name = "found", .value = failure.found } }),
|
||||
.repair_candidates = if (std.mem.startsWith(u8, source.name, "std.")) &.{} else failure.repair_candidates,
|
||||
};
|
||||
return error.InvalidSource;
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user