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
We wanted to suggest a tiny addition to the API, to control/increase the number of context lines around a label. It would make the hint much more readable, and doesn't force the user to click/navigate to the file to figure out the context around it.
For example, this is a typical label shown on line 5:
╭─[input.sol:5:5]
│
5 │ return r;
│ ┬
│ ╰── some hint text.
───╯
But if user sets Label::with_context_lines(2) (defaults to zero), it will show 2 more lines in both directions around line 5 (above and below):
╭─[input.sol:5:5]
│
3 │ // fetch result from server:
4 │ int r = fetchResult();
5 │ return r;
│ ┬
│ ╰── some hint text.
6 │ }
7 │ }
───╯
Or as an improvement, it can also support specific directions, with Label::with_context_lines_above(2) and Label::with_context_lines_below(2) .
Thanks!
The text was updated successfully, but these errors were encountered:
This would make some diagnostic messages (especially ones where white space is not important and the user can do as they please) a more informative and easier to understand.
Thanks for the really useful crate!
We wanted to suggest a tiny addition to the API, to control/increase the number of context lines around a label. It would make the hint much more readable, and doesn't force the user to click/navigate to the file to figure out the context around it.
For example, this is a typical label shown on line 5:
But if user sets
Label::with_context_lines(2)
(defaults to zero), it will show 2 more lines in both directions around line 5 (above and below):Or as an improvement, it can also support specific directions, with
Label::with_context_lines_above(2)
andLabel::with_context_lines_below(2)
.Thanks!
The text was updated successfully, but these errors were encountered: