Run formatter from Document directory (#12315)
Co-authored-by: Rob Gonnella <rob.gonnella@papayapay.com>
This commit is contained in:
parent
931dd9c1dc
commit
a83c23bb03
1 changed files with 6 additions and 0 deletions
|
@ -774,7 +774,13 @@ impl Document {
|
|||
{
|
||||
use std::process::Stdio;
|
||||
let text = self.text().clone();
|
||||
|
||||
let mut process = tokio::process::Command::new(&fmt_cmd);
|
||||
|
||||
if let Some(doc_dir) = self.path.as_ref().and_then(|path| path.parent()) {
|
||||
process.current_dir(doc_dir);
|
||||
}
|
||||
|
||||
process
|
||||
.args(fmt_args)
|
||||
.stdin(Stdio::piped())
|
||||
|
|
Loading…
Reference in a new issue