You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cue/errors: print relative positions when used as arguments too
Most positions in CUE errors are reported as a list to be printed
one per line, which is done using relative paths for the sake
of brevity and to make the paths "clickable" on some IDEs. For example:
builtin package "notinstd" undefined:
./missing.cue:1:8
However, sometimes positions are also used as part of error messages:
list redeclared as imported package name
previous declaration at /current/dir/missing.cue:4:1:
./missing.cue:2:8
Teach the cue/errors package to make these message argument positions
relative as well, which we can do pretty easily by spotting
which of the arguments are of type token.Pos and replacing them.
Note that this requires that the positions aren't stringified too early.
Signed-off-by: Daniel Martí <[email protected]>
Change-Id: Ie25c2018a4fb314e2686793009af931fc5a3d241
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1214612
Reviewed-by: Matthew Sackman <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
0 commit comments