Open
Description
Currently, we cannot handle Span
when using the proc-macro crate, which is problematic in many cases, like askama
when the generated code triggers an error and we can't show the users where in their templates the error originates from.
So an idea I had was to provide a method looking like this:
struct FileLocation {
line: u32,
column: u32,
}
fn span_from_representation(file: &Path, beginning: FileLocation, end: Option<FileLocation>) -> Option<Span>;
It would allow to get the span we need without having to manipulate the Span
content (which is not possible outside of the compiler anyway).