Auto merge of #12342 - lnicola:fix-join-lines, r=lnicola

fix: Fix broken async callback in join lines

Fixes #12338.
This commit is contained in:
bors 2022-05-21 15:39:16 +00:00
commit 3de03d4c61

View file

@ -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);
});
});