Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #12342 - lnicola:fix-join-lines, r=lnicola
fix: Fix broken async callback in join lines Fixes #12338.
bors 2022-05-21
parent 01d412f · parent 1e617f4 · commit 3de03d4
-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 ee8fa2eb51..bb4d2151ad 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);
});
});