rust-lang / rust-lang/rustfmt

Alternative approach for constructing the AST and mod/file mapping

Open
#3,930 1 comment 1 reaction 1 assignee View on GitHub

@calebcartwright is already working on this.

Since Feb 22, 2022.

A-modules
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.