aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-02-05 20:35:51 +0000
committerGitHub <[email protected]>2021-02-05 20:35:51 +0000
commit4cc333c889af82931222d5cdf7a5107df1afa834 (patch)
treef8699452c9450875f210f19ce543c6664f5485a2
parent4e86aee60b7b42263012461d527755a17fd1226f (diff)
parentfb2b1f5ea606edb1b868a133818ce36069360fed (diff)
Merge #7576
7576: Fix resolveCodeAction trying to edit files before creating them r=Veykril a=Veykril Fixes #7208 bors r+ Co-authored-by: Lukas Wirth <[email protected]>
-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