diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-02-05 20:35:51 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-05 20:35:51 +0000 |
| commit | 4cc333c889af82931222d5cdf7a5107df1afa834 (patch) | |
| tree | f8699452c9450875f210f19ce543c6664f5485a2 /editors/code/src | |
| parent | 4e86aee60b7b42263012461d527755a17fd1226f (diff) | |
| parent | fb2b1f5ea606edb1b868a133818ce36069360fed (diff) | |
| download | rust-4cc333c889af82931222d5cdf7a5107df1afa834.tar.gz rust-4cc333c889af82931222d5cdf7a5107df1afa834.zip | |
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 <lukastw97@gmail.com>
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); }; } |
