aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-02-05 20:26:14 +0000
committerLukas Wirth <[email protected]>2021-02-05 20:33:37 +0000
commitfb2b1f5ea606edb1b868a133818ce36069360fed (patch)
treef6d96697c99c20259f672d266b0b798ff3f6eada /editors/code/src
parent941f9157f5561868c4683d54fdf98378383f64b8 (diff)
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 c1c9f9754..cbda619ea 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -528,10 +528,10 @@ export function resolveCodeAction(ctx: Ctx): Cmd {
528 const edit = client.protocol2CodeConverter.asWorkspaceEdit(itemEdit); 528 const edit = client.protocol2CodeConverter.asWorkspaceEdit(itemEdit);
529 // filter out all text edits and recreate the WorkspaceEdit without them so we can apply 529 // filter out all text edits and recreate the WorkspaceEdit without them so we can apply
530 // snippet edits on our own 530 // snippet edits on our own
531 const itemEditWithoutTextEdits = { ...item, documentChanges: itemEdit.documentChanges?.filter(change => "kind" in change) }; 531 const lcFileSystemEdit = { ...itemEdit, documentChanges: itemEdit.documentChanges?.filter(change => "kind" in change) };
532 const editWithoutTextEdits = client.protocol2CodeConverter.asWorkspaceEdit(itemEditWithoutTextEdits); 532 const fileSystemEdit = client.protocol2CodeConverter.asWorkspaceEdit(lcFileSystemEdit);
533 await vscode.workspace.applyEdit(fileSystemEdit);
533 await applySnippetWorkspaceEdit(edit); 534 await applySnippetWorkspaceEdit(edit);
534 await vscode.workspace.applyEdit(editWithoutTextEdits);
535 }; 535 };
536} 536}
537 537