Skip to content

Preserve source filenames during inlining #15

@sunshowers

Description

@sunshowers

Thanks again for releasing version 0.4!

Looks like there's one more thing I need, which is the ability to report errors in the parsed syn::File. For that the main thing I need is to be able to map span data back to the files it came from.

How does this design sound?

  • Add an attribute to every inlined file with, say: #[syn_inline_mod_source_path = "..."]. Readers can then look through the attributes (add an API to syn-inline-mod to do so for convenience).
  • Add a method to InlinerBuilder which configures whether these annotations should be inserted (default false).

I'm planning to publish a crate that ties together syn-inline-mod and codespan-reporting so that tools can report custom errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions