diff options
| author | Laurențiu Nicola <lnicola@dend.ro> | 2022-05-21 18:38:10 +0300 |
|---|---|---|
| committer | Laurențiu Nicola <lnicola@dend.ro> | 2022-05-21 18:38:10 +0300 |
| commit | 1e617f4fc63e04fe53948d8efa694387b7d578ab (patch) | |
| tree | 702080dec9edbbd324781fe4bfe41b54b3f140d2 | |
| parent | 01d412f4d7bd7ef21a7e8f0461e9ba3439e3c4bf (diff) | |
| download | rust-1e617f4fc63e04fe53948d8efa694387b7d578ab.tar.gz rust-1e617f4fc63e04fe53948d8efa694387b7d578ab.zip | |
Fix broken async callback in join lines
| -rw-r--r-- | editors/code/src/commands.ts | 5 |
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); }); }); |
