-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
proc_macro: Add API for loading external files into the SourceMap #92565
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
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-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.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.
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-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
With this feature, proc macros (like
askama::Template) could parse external files and then emit diagnostics with appropriate spans.Proposed API
Other APIs are possible, but I was thinking of something like this:
I'm not super familiar with the
proc_macroAPI, so feel free to suggest better API designs.See also
See this discussion on Zulip and this discussion on GitHub for why I think this feature would be useful.