about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2021-02-05 21:26:14 +0100
committerLukas Wirth <lukastw97@gmail.com>2021-02-05 21:33:37 +0100
commitfb2b1f5ea606edb1b868a133818ce36069360fed (patch)
treef6d96697c99c20259f672d266b0b798ff3f6eada /editors/code/src
parent941f9157f5561868c4683d54fdf98378383f64b8 (diff)
downloadrust-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.ts6
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);
     };
 }