Skip to content

Allow to query whether a path is ignored/When using rustfmt via stdin allow passing a path #5137

Open
@Veykril

Description

@Veykril

In rust-analyzer we use rustfmt to format single files by passing the file content to it then writing the diff from that back to the file. This has the downside of us effectively ignoring the excluded paths from the rustfmt.toml.

Now we do not want to parse rustfmt.toml ourselves as this is basically duplicating work, hence the question arised whether it would be possible for rustfmt to either offer some way to ask for whether a path is excluded from it or even better to pass an optional path of a file as an argument when formatting via stdin input to have it basically do nothing if the path is ignored.

See rust-lang/rust-analyzer#10826

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions