Skip to content

Commit

Permalink
Auto merge of rust-lang#12342 - lnicola:fix-join-lines, r=lnicola
Browse files Browse the repository at this point in the history
fix: Fix broken async callback in join lines

Fixes rust-lang#12338.
  • Loading branch information
bors committed May 21, 2022
2 parents 01d412f + 1e617f4 commit 3de03d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions editors/code/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
Expand Down

0 comments on commit 3de03d4

Please sign in to comment.