Skip to content

rustfmt config file is not picked up in vs code when the project is in a subdirectory #7227

Closed
@AlexAegis

Description

@AlexAegis

Consider a freshly cargo init-ed project with an added .rustfmt.toml

.
├── .rustfmt.toml
├── Cargo.toml
└── src
    └── main.rs

In this case the format config is picked up as usual and when formatting main.rs is formatted according to the configuration file.

Now consider a project where this rust project lives in a subdirectory

.
└── project
    ├── .rustfmt.toml
    ├── Cargo.toml
    ├── LICENSE
    └── src
        └── main.rs

In this case the configuration file is not picked up, and I have to symlink it to the root as a workaround or open it separately so that project is the root. I suggest calling rustfmt from the directory of the formatted .rs file instead of the project root.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions