-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
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).
Metadata
Metadata
Assignees
Labels
A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.