Open Luro02 opened 4 years ago
This is not possible afaik, because we do not want to emit the span as a compiler error and instead as a Spannable<String>
that is attached to an error.
Therefore I started reimplementing the spanning as a separate crate, that will ideally be no_std
and that supports to_string
.
I found 3 crates, which let you span m3u8 files:
I would personally love to have span metadata (optionally?) for all parsed elements, not just from errors.
Motivation would be enabling code using this crate to support rendering diagnostics like:
error: the referenced media segment could not be retrieved
--> http://media.example.com/example.m3u8:7:1
|
7 | second.ts
| ^^^^^^^^^ HTTP 404
= note: 404 for URL http://media.example.com/second.ts
or
error: media segment duration descrepancy
--> tests/example.m3u8:7:1
|
6 | #EXTINF:9.009,
^^^^^ manifest declared duration is 9.009
7 | second.ts
| ^^^^^^^^^ but this segment's actual duration is 18.018
I think I read somewhere, that
Span
s can work with arbitrary file formats and it is not limited to rust code. It would be cool to have an error, that when displayed does include the relevant code;