-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Absolutely bamboozled while trying to have pretty printed binary data as source code #281
Comments
Yeah miette doesn't really support pretty-printed text very well--you can technically get things pointing at the right place, but that requires a lot of effort on your part. It's not a surprise you're having trouble with this, and I don't really have a solution for you right now. It's one of those backlog things that are fairly hard problems to solve. |
Ahh, alright. That makes sense Is there anything I can do in the meantime then? |
You'll have to print stuff without syntax highlighting |
I'm trying to use miette for my crate's error type. My crate parses binary data, and the errors can be quite difficult to understand, so I decided to pull miette in and see how it'd work.
miette's
SourceCode
impl for[u8]
assumes it is string data, which means any users whose source is binary data need to write a custom impl. Atm, I'm stuck trying to figure out how to calculate where theSourceSpan
offsets should go. Changing the offsets seems to move it completely- and higher offsets appear earlier in the text than they should?I'm trying to pass in offsets into the original binary data, but they won't correspond exactly to the stringified version. Does that have something to do with it?
I have no idea what I'm doing, could I get some help?
The text was updated successfully, but these errors were encountered: