Fix broken async callback in join lines

This commit is contained in:
Laurențiu Nicola 2022-05-21 18:38:10 +03:00
parent 01d412f4d7
commit 1e617f4fc6

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