mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Use ignoreIfExists for creating new files during refactorings
This commit is contained in:
@@ -57,11 +57,7 @@ class ApplyRefactoringCommand implements Command {
|
||||
private async toWorkspaceEdit(body: Proto.RefactorEditInfo) {
|
||||
const workspaceEdit = new vscode.WorkspaceEdit();
|
||||
for (const edit of body.edits) {
|
||||
try {
|
||||
await vscode.workspace.openTextDocument(edit.fileName);
|
||||
} catch {
|
||||
workspaceEdit.createFile(this.client.toResource(edit.fileName));
|
||||
}
|
||||
workspaceEdit.createFile(this.client.toResource(edit.fileName), { ignoreIfExists: true });
|
||||
}
|
||||
typeConverters.WorkspaceEdit.withFileCodeEdits(workspaceEdit, this.client, body.edits);
|
||||
return workspaceEdit;
|
||||
|
||||
Reference in New Issue
Block a user