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
With long lines that are wrapped, it's unclear which part of the line is being pointed to.
Here's a screenshot, as an example:
And as text:
Error: gen_completions::deser::kdl::duplicate_flag (link)
× Error encountered while deserializing
╰─▶ Error encountered while reading command information
╭─[test.kdl:2:1]
2 │ flags {
3 │ "-h" "--very long string in between to make it span multiple lines aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "-h" {
· ──┬─ ──┬─
· │ ╰── duplicate flag
· ╰── already given here
4 │ desc "foo bar baz"
╰────
As you can see, when my terminal wraps that long line, it can be hard to tell where exactly the span is pointing. Is there a way to underline or highlight the text covered by those spans? I checked out GraphicalTheme, but that doesn't seem to have a way to configure this. I guess I could write my own ReportHandler based off of miette's, but that would take effort.
If such a feature doesn't exist in miette but the maintainers are fine with adding it, I could try implementing it. Apologies if someone's asked about this already, but I couldn't find any issues.
The text was updated successfully, but these errors were encountered:
#20 is possibly related. My understanding of the idea with #20 is that we could trim snippets horizontally similar to the way we're currently trimming them vertically (by only rendering a few context lines around the span).
In your example, I'm imagining that might look something like this:
Error: gen_completions::deser::kdl::duplicate_flag (link)
× Error encountered while deserializing
╰─▶ Error encountered while reading command information
╭─[test.kdl:2:1]
2 │ flags {
3 │ "-h" "--very long string ··· aaaaaa" "-h" {
· ──┬─ ──┬─
· │ ╰── duplicate flag
· ╰── already given here
4 │ desc "foo bar baz"
╰────
I think having an option in GraphicalTheme to highlight spans by swapping the fg/bg colors or with ansi underlines would be useful, even if the issues with long lines are solved another way. There was a great blog post I saw a while ago that recommended fg/bg swap as the default way to format compiler errors because it has a better shot at handling things like bidi text or misprediction of character display widths. I don't fully agree that it should be the default, but think it would be a good to support as an option. Unfortunately, I couldn't find the original post :(
With long lines that are wrapped, it's unclear which part of the line is being pointed to.
Here's a screenshot, as an example:
And as text:
As you can see, when my terminal wraps that long line, it can be hard to tell where exactly the span is pointing. Is there a way to underline or highlight the text covered by those spans? I checked out
GraphicalTheme
, but that doesn't seem to have a way to configure this. I guess I could write my ownReportHandler
based off of miette's, but that would take effort.If such a feature doesn't exist in miette but the maintainers are fine with adding it, I could try implementing it. Apologies if someone's asked about this already, but I couldn't find any issues.
The text was updated successfully, but these errors were encountered: