about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-05-21 15:39:16 +0000
committerbors <bors@rust-lang.org>2022-05-21 15:39:16 +0000
commit3de03d4c61d2405b66337b96ea97aa21f7d04e4b (patch)
tree702080dec9edbbd324781fe4bfe41b54b3f140d2
parent01d412f4d7bd7ef21a7e8f0461e9ba3439e3c4bf (diff)
parent1e617f4fc63e04fe53948d8efa694387b7d578ab (diff)
downloadrust-3de03d4c61d2405b66337b96ea97aa21f7d04e4b.tar.gz
rust-3de03d4c61d2405b66337b96ea97aa21f7d04e4b.zip
Auto merge of #12342 - lnicola:fix-join-lines, r=lnicola
fix: Fix broken async callback in join lines

Fixes #12338.
-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);
             });
         });