Closed as not planned
Description
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:
impl SourceFile {
pub fn span(&self) -> Span { ... }
pub fn contents(&self) -> &str { ... }
pub fn load(path: &Path) -> Self { ... }
}
I'm not super familiar with the proc_macro
API, 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.