1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 06:21:14 +02:00

add pos to errorinfo, remove from hints

This commit is contained in:
Ben Burdette 2020-05-08 18:18:28 -06:00
parent 1b801cec40
commit 55eb717148
13 changed files with 507 additions and 194 deletions

View file

@ -126,17 +126,28 @@ int main()
// Error with previous and next lines of code.
logError(
ErrorInfo { .name = "error name",
.description = "error description",
.description = "error with code lines",
.hint = hintfmt("this hint has %1% templated %2%!!",
"yellow",
"values"),
.nixCode = NixCode {
.errPos = Pos(problem_file, 40, 13),
.prevLineOfCode = std::optional("previous line of code"),
.prevLineOfCode = "previous line of code",
.errLineOfCode = "this is the problem line of code",
.nextLineOfCode = std::optional("next line of code"),
.nextLineOfCode = "next line of code",
}});
// Error without lines of code.
logError(
ErrorInfo { .name = "error name",
.description = "error without any code lines.",
.hint = hintfmt("this hint has %1% templated %2%!!",
"yellow",
"values"),
.nixCode = NixCode {
.errPos = Pos(problem_file, 40, 13)
}});
return 0;
}