-
Notifications
You must be signed in to change notification settings - Fork 44
Handle missing sources #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm curious how you have access to line and column information without the source. There might be some overlap with #38. We are working on an API redesign to support Suggestions and it might offer us an opportunity to offer |
It so happens that rustc's
That sounds good. To be clear the thing that annoys me most in my case is the two extra |
Support for this was added in #195, see annotate-snippets-rs/tests/rustc_tests.rs Lines 1842 to 1849 in 68342cc
|
Sometimes I don't have access to the source text for one reason or another, but I'd still like to display a message with a file name and line/col numbers, e.g
(that's how rustc renders that today).
As far as I can tell this isn't supported with the current API. The closest I managed is to use a snippet with empty source and add the line/col numbers by hand in the origin.
I get (note the two empty lines starting with
|
, and the lack of indentation of the-->
arrow):Trying to add an annotation with a span obviously panics because the span is not in range of the empty string.
Would it be possible to have a
Snippet::no_source()
builder that supports annotations with spans and renders them like the above?The text was updated successfully, but these errors were encountered: