This library allows you to load full source code of multi-file crates into a single syn::File
.
Features:
syn
crate.#[path]
attributes#[cfg]
where it affects modules to filesystem mappingStart exploring the library from the [read_full_crate_source_code
] function.
synfileexpand
tool expands Rust sources, like cargo expand
, but without macro expansion, only for modules.
rustc
is not involved.
```text $ synfileexpand src/lib.rs | rustfmt
... mod attrs { use super::AttrParseError; ... } mod expand_impl { use crate::{attrs, Error, ErrorCase, Resolver}; ... }
$ synfileexpand
Usage: synfileexpand
There is a Github release with the tool pre-built for various platforms. To build the tool from source code, use expand
example.