Skip to content
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

miette #347 has been merged, fixing #219 #77

Open
FrankReh opened this issue Apr 11, 2024 · 2 comments
Open

miette #347 has been merged, fixing #219 #77

FrankReh opened this issue Apr 11, 2024 · 2 comments

Comments

@FrankReh
Copy link

FrankReh commented Apr 11, 2024

zkat/miette#347 landed on Feb 21.

Maybe this comment can be addressed now?

pub fn span(&self) -> SourceSpan {
let mut span = self.0.span();
if span.end == self.0.source().len() {
// Currently miette silently fails to display a label
// if the span is at the end of the source; this means
// we can't properly show the "end of input" span.
// For now, have the span point at the last byte in the source.
// See: https://github.com/zkat/miette/issues/219
span.start -= 1;
span.end = span.start + 1;
}
to_source_span(span)
}

@peterhuene
Copy link
Member

Thanks for the suggestion!

I think the miette fix will now at least not be silent when the span is invalid, but that's not how we want it to behave for being able to convey an unexpected end-of-input (i.e. show highlight one past the last valid offset).

I'll test it out, but we'd probably need a feature request from miette if we want it to happen.

@FrankReh
Copy link
Author

Thanks for taking a look. I hoped you would know if the special case could be removed straight away or if there were now something new to consider. I know your plate is full right now. I can't say I have even run your wac binary yet so can't offer help yet. Still getting my head around all the new stuff since WASI Preview 2 and the tooling the BA is providing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants