annotate-snippets-rs icon indicating copy to clipboard operation
annotate-snippets-rs copied to clipboard

Add InlineAnnotation

Open zbraniecki opened this issue 6 years ago • 3 comments

This is an experimental concept to annotate source inline on top of annotating it below.

zbraniecki avatar Oct 29 '19 21:10 zbraniecki

This is an experiment in extending the API to support inline annotations.

I'm not sure if it's worth it, but wanted to give it a try and got it to work!

Screen Shot 2019-10-29 at 2 16 01 PM

Alternatively, I was thinking of extending SourceAnnotation to allow users to specify the display format - under, inline or both, but that made the API a bit less readable IMO.

zbraniecki avatar Oct 29 '19 21:10 zbraniecki

All I had to add to the examples/format.rs is:

Screen Shot 2019-10-29 at 2 17 54 PM

zbraniecki avatar Oct 29 '19 21:10 zbraniecki

@CAD97, @wycats, @brendanzab - thoughts?

I think it may be a path forward to allow for source coloring, if we enable custom "styles" and allow for such annotations. Not sure if it's the best way, but it's an option.

My primary goal is to visually aid analyzing the slice, not syntax coloring.

zbraniecki avatar Oct 29 '19 21:10 zbraniecki