about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLaurențiu Nicola <lnicola@dend.ro>2022-05-21 18:38:10 +0300
committerLaurențiu Nicola <lnicola@dend.ro>2022-05-21 18:38:10 +0300
commit1e617f4fc63e04fe53948d8efa694387b7d578ab (patch)
tree702080dec9edbbd324781fe4bfe41b54b3f140d2
parent01d412f4d7bd7ef21a7e8f0461e9ba3439e3c4bf (diff)
downloadrust-1e617f4fc63e04fe53948d8efa694387b7d578ab.tar.gz
rust-1e617f4fc63e04fe53948d8efa694387b7d578ab.zip
Fix broken async callback in join lines
-rw-r--r--editors/code/src/commands.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index ee8fa2eb51d..bb4d2151ad7 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -125,8 +125,9 @@ export function joinLines(ctx: Ctx): Cmd {
                 editor.document
             ),
         });
-        await editor.edit(async (builder) => {
-            (await client.protocol2CodeConverter.asTextEdits(items)).forEach((edit: any) => {
+        const textEdits = await client.protocol2CodeConverter.asTextEdits(items);
+        await editor.edit((builder) => {
+            textEdits.forEach((edit: any) => {
                 builder.replace(edit.range, edit.newText);
             });
         });