diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2021-02-05 21:26:14 +0100 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2021-02-05 21:33:37 +0100 |
| commit | fb2b1f5ea606edb1b868a133818ce36069360fed (patch) | |
| tree | f6d96697c99c20259f672d266b0b798ff3f6eada /editors/code/src | |
| parent | 941f9157f5561868c4683d54fdf98378383f64b8 (diff) | |
| download | rust-fb2b1f5ea606edb1b868a133818ce36069360fed.tar.gz rust-fb2b1f5ea606edb1b868a133818ce36069360fed.zip | |
Fix resolveCodeAction trying to edit files before creating them
Diffstat (limited to 'editors/code/src')
| -rw-r--r-- | editors/code/src/commands.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts index c1c9f9754dd..cbda619ea9d 100644 --- a/editors/code/src/commands.ts +++ b/editors/code/src/commands.ts @@ -528,10 +528,10 @@ export function resolveCodeAction(ctx: Ctx): Cmd { const edit = client.protocol2CodeConverter.asWorkspaceEdit(itemEdit); // filter out all text edits and recreate the WorkspaceEdit without them so we can apply // snippet edits on our own - const itemEditWithoutTextEdits = { ...item, documentChanges: itemEdit.documentChanges?.filter(change => "kind" in change) }; - const editWithoutTextEdits = client.protocol2CodeConverter.asWorkspaceEdit(itemEditWithoutTextEdits); + const lcFileSystemEdit = { ...itemEdit, documentChanges: itemEdit.documentChanges?.filter(change => "kind" in change) }; + const fileSystemEdit = client.protocol2CodeConverter.asWorkspaceEdit(lcFileSystemEdit); + await vscode.workspace.applyEdit(fileSystemEdit); await applySnippetWorkspaceEdit(edit); - await vscode.workspace.applyEdit(editWithoutTextEdits); }; } |
