Commit 342d9ed
committed
Fix rustfmt relative custom command
When `rustfmt.overrideCommand` is a relative path, it's joined with the
workspace root to make it an absolute path. Without this the command
path can't be resolved, especially because rustfmt changes the cwd to
make sure rustfmt.toml works correctly.
Currently `run_rustfmt` only does this when it finds a `target_spec`
using `target_spec_for_file` which only works for the root file of the
target.
This commit changes it to use `TargetSpec::from_file` which works for
any file in the crate.1 parent 64ddb54 commit 342d9ed
1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2442 | 2442 | | |
2443 | 2443 | | |
2444 | 2444 | | |
2445 | | - | |
2446 | | - | |
| 2445 | + | |
2447 | 2446 | | |
2448 | 2447 | | |
2449 | 2448 | | |
| |||
0 commit comments