diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-31 11:21:23 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-31 11:21:23 +0000 |
commit | 53e2cdf18e155ad61262fed5dcd3d73ef343c042 (patch) | |
tree | 8414439a6141133dd2eb68ffd94f0ede306870f3 /crates/syntax/src/ast/node_ext.rs | |
parent | 558206f70e418730967fd690f5f219993de071bc (diff) | |
parent | 5ce420ac8487d991ead53f51ae2d45ef33d4f94e (diff) |
Merge #7055
7055: Install rustfmt if needed during formatting request r=matklad a=kinnison
In order to fix #6052 and to fix #4249 this PR installs `rustfmt` using `rustup` if `rustfmt --help` fails.
In theory we ought to memoise the attempts (both the `--help` and the installation) so that we don't keep retrying something which will fail (e.g. if nightly is missing rustfmt), but this is a first-pass for opinions.
In order to make it possible to notify the user of what happened, I added a facility for `GlobalStateSnapshot` to send *messages* to the client indicating what happened. There may be a cleaner way to do this as well but I wasn't sure exactly what might be best given this is my first time in this codebase.
It may be worth, longer term, working with `rustup` to provide a way to detect a missing component binary since `rustup` returns `1` if `rustfmt` is not installed, which is not ideal.
Co-authored-by: Daniel Silverstone <[email protected]>
Diffstat (limited to 'crates/syntax/src/ast/node_ext.rs')
0 files changed, 0 insertions, 0 deletions