Alternative approach for constructing the AST and mod/file mapping
@calebcartwright is already working on this.
Since Feb 22, 2022.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
There's been a couple issues of late with syntax/parse errors stemming from files that rustfmt was configured to ignore. The underlying cause has been traced to how the complete AST is constructed for the crate up front and the mod nodes in the AST are then associated to the corresponding files.
Based on discussion in some other threads, it should be possible to construct the AST and create the file/mod mapping via a different approach that addresses the issues encountered currently (and also avoids having to parse and construct an AST for files that rustfmt is just going to ignore anyway).
There's a lot more detail from @topecongiro on the underlying cause with the current approach and the new approach in https://github.com/rust-lang/rustfmt/pull/3920#issuecomment-554148668
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.