Skip to content

Commit

Permalink
删除文件可以恢复
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Apr 8, 2024
1 parent 615df33 commit 5cebc3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
},
{
"command": "y3-helper.deleteEditorTableItem",
"title": "Y3:删除物编项目(删除后不可恢复)",
"title": "Y3:删除物编项目",
"enablement": "view == y3-helper.editorTableView && viewItem == json"
},
{
Expand Down
3 changes: 2 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@ class Helper {
// 右键菜单的命令注册
vscode.commands.registerCommand("y3-helper.deleteEditorTableItem", (fileNode: FileNode) => {
try {
vscode.workspace.fs.delete(fileNode.resourceUri);
vscode.workspace.fs.delete(fileNode.resourceUri, { useTrash: true });
vscode.window.showInformationMessage("删除成功(可从回收站恢复)");
}
catch (error) {
vscode.window.showErrorMessage("删除失败,错误为" + error);
Expand Down

0 comments on commit 5cebc3e

Please sign in to comment.