Port changes to zed2

This commit is contained in:
Kirill Bulatov 2023-11-03 11:02:38 +02:00
parent 24dd1c5812
commit 09346fb9f1
8 changed files with 1059 additions and 501 deletions

View file

@ -4157,7 +4157,9 @@ impl Project {
match prettier_task.await
{
Ok(prettier) => {
let buffer_path = buffer.update(&mut cx, |buffer, cx| File::from_dyn(buffer.file()).map(|f| f.abs_path(cx)));
let buffer_path = buffer.update(&mut cx, |buffer, cx| {
File::from_dyn(buffer.file()).map(|file| file.abs_path(cx))
});
format_operation = Some(FormatOperation::Prettier(
prettier
.format(buffer, buffer_path, &cx)
@ -4213,7 +4215,9 @@ impl Project {
match prettier_task.await
{
Ok(prettier) => {
let buffer_path = buffer.update(&mut cx, |buffer, cx| File::from_dyn(buffer.file()).map(|f| f.abs_path(cx)));
let buffer_path = buffer.update(&mut cx, |buffer, cx| {
File::from_dyn(buffer.file()).map(|file| file.abs_path(cx))
});
format_operation = Some(FormatOperation::Prettier(
prettier
.format(buffer, buffer_path, &cx)