miette icon indicating copy to clipboard operation
miette copied to clipboard

Render diagnostics without exiting?

Open zmitchell opened this issue 8 months ago • 5 comments

Say I have a user editing a file and if it doesn’t parse to the correct format I want to display the error and ask if they’d like to try again. Essentially we have an edit loop that runs until they get it right or quit. How do I get miette to render the error on each loop iteration?

I’ve tried just using println!, but only the error(…) annotation is displayed (no snippet, etc). I’ve checked that the span and source code are as expected. I checked which type of report handler is being used, and it’s not the graphical handler, though it also seems like I don’t have a way to force one to be used.

Any advice?

zmitchell avatar Jun 19 '24 19:06 zmitchell