Skip to content

Commit

Permalink
fix: 修复无法打开 workspace 的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mohuishou committed Apr 7, 2021
1 parent 6e2a443 commit 78cbb85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion plugins/vscode/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "830ef6d0",
"pluginName": "vscode",
"description": "快速搜索vscode历史项目并且在vscode中打开",
"version": "v3.1.0",
"version": "v3.1.1",
"preload": "dist/preload.js",
"author": "莫回首",
"homepage": "https://github.com/mohuishou/utools",
Expand Down
15 changes: 8 additions & 7 deletions plugins/vscode/src/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ export class VSCode implements Plugin {
}

return [...new Set(files)].map((file: any) => {
if (typeof file === "object" && "configURIPath" in file) {
file = file.configURIPath;
}
if (typeof file === "object" && ("folderUri" in file || "fileUri" in file)) {
file = file.folderUri || file.fileUri;
}
return decodeURIComponent(file);
if (typeof file === "string") return decodeURIComponent(file);
if (typeof file !== "object") return;

let keys = ["configURIPath", "folderUri", "fileUri"];
let k = keys.find((k) => k in file);
if (k) return decodeURIComponent(file[k]);

if ("workspace" in file) return decodeURIComponent(file.workspace.configPath);
});
}

Expand Down

0 comments on commit 78cbb85

Please sign in to comment.