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
error: Test bad order
┌─ <test>:1:1
│
1 │ line 1
│ ^^^^^^ second msg
2 │ line 2
│ ^^^^^^ first msg
The second message is reported first. This makes sense for compile-time errors, but in my case I use codespan for an interpreted language and I want to report runtime errors where there is an associated temporal order of the labels, such as printing a callstack for example (a list of successive calls to some functions). In this case I don't want the labels to be re-ordered based on the position of their snippet in the original source file, and I would like the end result to be:
error: Test bad order
┌─ <test>:1:1
│
2 │ line 2
│ ^^^^^^ first msg
1 │ line 1
│ ^^^^^^ second msg
Is there a simple way to do that using codespan ?
The text was updated successfully, but these errors were encountered:
Thanks for your issue, but this was basically already discussed in #231.
This means there is no simple way to do this in the current version of codespan. Maybe by using multiple diagnostics? But other than that I think codespan is not quite intended for what you want to do.
Maybe this should be added to the documentation.
Johann150
added a commit
to Johann150/codespan
that referenced
this issue
Sep 14, 2020
Currently, the order in which labels are displayed depends on the respective position of the annotated snippets in the source.
For example, if I do:
I get
The second message is reported first. This makes sense for compile-time errors, but in my case I use codespan for an interpreted language and I want to report runtime errors where there is an associated temporal order of the labels, such as printing a callstack for example (a list of successive calls to some functions). In this case I don't want the labels to be re-ordered based on the position of their snippet in the original source file, and I would like the end result to be:
Is there a simple way to do that using codespan ?
The text was updated successfully, but these errors were encountered: