diff --git a/package.json b/package.json index 0ec674e..244a3ae 100644 --- a/package.json +++ b/package.json @@ -297,6 +297,10 @@ "command": "_projectManager.editTags", "title": "%projectManager.commands.editTags.title%" }, + { + "command": "_projectManager.editProjectPath", + "title": "%projectManager.commands.editProjectPath.title%" + }, { "command": "projectManager.whatsNew", "title": "%projectManager.commands.whatsNew.title%" diff --git a/package.nls.cs.json b/package.nls.cs.json index f11b065..515d0ca 100644 --- a/package.nls.cs.json +++ b/package.nls.cs.json @@ -32,6 +32,7 @@ "projectManager.commands.deleteProject.title": "Smazat projekt", "projectManager.commands.renameProject.title": "Přejmenovat projekt", "projectManager.commands.editTags.title": "Upravit značky", + "projectManager.commands.editProjectPath.title": "Upravit cestu projektu", "projectManager.commands.viewAsTags#sideBarFavorites.title": "Zobrazit jako značky", "projectManager.commands.viewAsList#sideBarFavorites.title": "Zobrazit jako seznam", "projectManager.submenus.viewAndSort#sideBarFavorites.title": "Zobrazit a třídit", @@ -82,4 +83,4 @@ "projectManager.configuration.openInCurrentWindowIfEmpty.description": "Označuje, zda příkaz \"Nové okno\" otevře projekt v aktuálním okně, je-li prázdný.", "projectManager.configuration.confirmSwitchOnActiveWindow.description": "Řídí, zda má rozšíření žádat o potvrzení při otevírání projektů v aktivním okně.", "projectManager.configuration.tags.description": "Označuje seznam značek, které můžete použít k uspořádání projektů" -} \ No newline at end of file +} diff --git a/package.nls.fr.json b/package.nls.fr.json index 108329a..9d20350 100644 --- a/package.nls.fr.json +++ b/package.nls.fr.json @@ -32,6 +32,7 @@ "projectManager.commands.deleteProject.title": "Supprimer le projet", "projectManager.commands.renameProject.title": "Renommer le projet", "projectManager.commands.editTags.title": "Modifier les étiquettes", + "projectManager.commands.editProjectPath.title": "Modifier le chemin du projet", "projectManager.commands.viewAsTags#sideBarFavorites.title": "Voir en tant qu'étiquettes", "projectManager.commands.viewAsList#sideBarFavorites.title": "Voir comme liste", "projectManager.submenus.viewAndSort#sideBarFavorites.title": "Afficher et trier", @@ -99,4 +100,4 @@ "projectManager.walkthroughs.exclusiveSideBar.description": "Une barre latérale exclusive avec tout ce dont vous avez besoin pour une meilleure productivité.\n[Ouvrir la barre latérale](command:_projectManager.openSideBar)", "projectManager.walkthroughs.workingWithRemotes.title": "Travailler à distance", "projectManager.walkthroughs.workingWithRemotes.description": "L'extension prend en charge les scénarios de [développement à distance] (https://code.visualstudio.com/docs/remote/remote-overview), et vous pouvez choisir comment l'utiliser, en fonction de vos besoins." -} \ No newline at end of file +} diff --git a/package.nls.json b/package.nls.json index ca87cc0..56f570f 100644 --- a/package.nls.json +++ b/package.nls.json @@ -42,6 +42,7 @@ "projectManager.commands.deleteProject.title": "Delete Project", "projectManager.commands.renameProject.title": "Rename Project", "projectManager.commands.editTags.title": "Edit Tags", + "projectManager.commands.editProjectPath.title": "Edit Project Path", "projectManager.commands.viewAsTags#sideBarFavorites.title": "View as Tags", "projectManager.commands.viewAsList#sideBarFavorites.title": "View as List", "projectManager.submenus.viewAndSort#sideBarFavorites.title": "View & Sort", @@ -110,4 +111,4 @@ "projectManager.walkthroughs.exclusiveSideBar.description": "An exclusive Side Bar with everything you need for great productivity.\n[Open Side Bar](command:_projectManager.openSideBar)", "projectManager.walkthroughs.workingWithRemotes.title": "Working with Remotes", "projectManager.walkthroughs.workingWithRemotes.description": "The extension support [Remote Development](https://code.visualstudio.com/docs/remote/remote-overview) scenarios, and you may choose how to use it, depending on your needs." -} \ No newline at end of file +} diff --git a/package.nls.pt-br.json b/package.nls.pt-br.json index b6d9f21..be8a6ea 100644 --- a/package.nls.pt-br.json +++ b/package.nls.pt-br.json @@ -42,6 +42,7 @@ "projectManager.commands.deleteProject.title": "Excluir Projeto", "projectManager.commands.renameProject.title": "Renomear Projeto", "projectManager.commands.editTags.title": "Editar Etiquetas", + "projectManager.commands.editProjectPath.title": "Editar Caminho do Projeto", "projectManager.commands.viewAsTags#sideBarFavorites.title": "Exibir como Etiquetas", "projectManager.commands.viewAsList#sideBarFavorites.title": "Exibir como Lista", "projectManager.submenus.viewAndSort#sideBarFavorites.title": "Exibir & Ordenação", @@ -110,4 +111,4 @@ "projectManager.walkthroughs.exclusiveSideBar.description": "Uma Barra Lateral exclusiva com tudo que você precisa para aumentar sua produtividade.\n[Abrir Barra Lateral](command:_projectManager.openSideBar)", "projectManager.walkthroughs.workingWithRemotes.title": "Trabalhando com Remotos", "projectManager.walkthroughs.workingWithRemotes.description": "A extensão suporta cenários de [Desenvolvimento Remoto](https://code.visualstudio.com/docs/remote/remote-overview), e você pode escolher como usar, dependendo das suas necessidades." -} \ No newline at end of file +} diff --git a/package.nls.ru.json b/package.nls.ru.json index 23a8b89..d2238d1 100644 --- a/package.nls.ru.json +++ b/package.nls.ru.json @@ -32,6 +32,7 @@ "projectManager.commands.deleteProject.title": "Удалить проект", "projectManager.commands.renameProject.title": "Переименовать проект", "projectManager.commands.editTags.title": "Отредактировать тэги", + "projectManager.commands.editProjectPath.title": "Изменить путь проекта", "projectManager.commands.viewAsTags#sideBarFavorites.title": "Просмотреть как теги", "projectManager.commands.viewAsList#sideBarFavorites.title": "Просмотреть как список", "projectManager.submenus.viewAndSort#sideBarFavorites.title": "Просмотр и сортировка", @@ -82,4 +83,4 @@ "projectManager.configuration.openInCurrentWindowIfEmpty.description": "Указывает, открывает ли команда «Новое окно» проект в текущем пустом окне.", "projectManager.configuration.confirmSwitchOnActiveWindow.description": "Определяет, должно ли расширение запрашивать подтверждение при открытии проектов в активном окне.", "projectManager.configuration.tags.description": "Указывает список тегов, которые вы можете использовать для организации ваших проектов." -} \ No newline at end of file +} diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index ea7d6a4..2a57f18 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -42,6 +42,7 @@ "projectManager.commands.deleteProject.title": "删除项目", "projectManager.commands.renameProject.title": "重命名项目", "projectManager.commands.editTags.title": "编辑标签", + "projectManager.commands.editProjectPath.title": "编辑项目路径", "projectManager.commands.viewAsTags#sideBarFavorites.title": "作为标签查看", "projectManager.commands.viewAsList#sideBarFavorites.title": "以列表形式查看", "projectManager.submenus.viewAndSort#sideBarFavorites.title": "查看与排序", diff --git a/package.nls.zh-tw.json b/package.nls.zh-tw.json index 1254296..faa4a7e 100644 --- a/package.nls.zh-tw.json +++ b/package.nls.zh-tw.json @@ -32,6 +32,7 @@ "projectManager.commands.deleteProject.title": "刪除項目", "projectManager.commands.renameProject.title": "重命名項目", "projectManager.commands.editTags.title": "編輯標簽", + "projectManager.commands.editProjectPath.title": "編輯項目路徑", "projectManager.commands.viewAsTags#sideBarFavorites.title": "作為標簽查看", "projectManager.commands.viewAsList#sideBarFavorites.title": "以列表形式查看", "projectManager.submenus.viewAndSort#sideBarFavorites.title": "查看和排序", @@ -99,4 +100,4 @@ "projectManager.walkthroughs.exclusiveSideBar.description": "專屬側邊欄包含您實現高效工作所需的一切。\n[打開側邊欄](command:_projectManager.openSideBar)", "projectManager.walkthroughs.workingWithRemotes.title": "使用遠程工作", "projectManager.walkthroughs.workingWithRemotes.description": "該擴展支持 [遠程開發](https://code.visualstudio.com/docs/remote/remote-overview) 場景,您可以根據需要選擇如何使用它。" -} \ No newline at end of file +} diff --git a/src/extension.ts b/src/extension.ts index 458335a..30ad728 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -118,6 +118,7 @@ export async function activate(context: vscode.ExtensionContext) { vscode.commands.registerCommand("_projectManager.deleteProject", (node) => deleteProject(node)); vscode.commands.registerCommand("_projectManager.renameProject", (node) => renameProject(node)); vscode.commands.registerCommand("_projectManager.editTags", (node) => editTags(node)); + vscode.commands.registerCommand("_projectManager.editProjectPath", (node) => editProjectPath(node)); vscode.commands.registerCommand("projectManager.addToFavorites", (node) => saveProject(node)); vscode.commands.registerCommand("_projectManager.toggleProjectEnabled", (node) => toggleProjectEnabled(node)); @@ -475,6 +476,24 @@ export async function activate(context: vscode.ExtensionContext) { } } + async function editProjectPath(node: any) { + + const project = projectStorage.existsWithRootPath(node.command.arguments[0]); + if (!project) { + return; + } + + const projectDetails = await getProjectDetails(project.name, project.rootPath); + if (!projectDetails) { + return; + } + + projectStorage.updateRootPath(project.name, projectDetails.path); + projectStorage.save(); + providerManager.updateTreeViewStorage(); + vscode.window.showInformationMessage(l10n.t("Project updated!")); + } + function toggleProjectEnabled(node: any, askForUndo = true) { const projectName: string = node.command.arguments[1]; const enabled: boolean = projectStorage.toggleEnabled(projectName); @@ -513,4 +532,4 @@ export function deactivate() { // } locators.dispose(); -} \ No newline at end of file +}