Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@
"category": "Python",
"icon": "$(new-folder)"
},
{
"command": "python-envs.addPythonProjectGivenResource",
"title": "%python-envs.addPythonProjectGivenResource.title%",
"category": "Python",
"icon": "$(new-folder)"
},
{
"command": "python-envs.removePythonProject",
"title": "%python-envs.removePythonProject.title%",
Expand Down Expand Up @@ -292,6 +298,10 @@
"command": "python-envs.addPythonProject",
"when": "false"
},
{
"command": "python-envs.addPythonProjectGivenResource",
"when": "false"
},
{
"command": "python-envs.removePythonProject",
"when": "false"
Expand Down Expand Up @@ -455,12 +465,12 @@
],
"explorer/context": [
{
"command": "python-envs.addPythonProject",
"command": "python-envs.addPythonProjectGivenResource",
"group": "inline",
"when": "explorerViewletVisible && explorerResourceIsFolder && !python-envs:isExistingProject"
},
{
"command": "python-envs.addPythonProject",
"command": "python-envs.addPythonProjectGivenResource",
"group": "inline",
"when": "explorerViewletVisible && resourceExtname == .py && !python-envs:isExistingProject"
}
Expand Down Expand Up @@ -560,4 +570,4 @@
"vscode-jsonrpc": "^9.0.0-next.5",
"which": "^4.0.0"
}
}
}
5 changes: 3 additions & 2 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"python-envs.terminal.revertStartupScriptChanges.title": "Revert Shell Startup Script Changes",
"python-envs.setEnvManager.title": "Set Environment Manager",
"python-envs.setPkgManager.title": "Set Package Manager",
"python-envs.addPythonProject.title": "Add as Python Project",
"python-envs.addPythonProject.title": "Add Python Project",
"python-envs.addPythonProjectGivenResource.title": "Add as Python Project",
"python-envs.removePythonProject.title": "Remove Python Project",
"python-envs.copyEnvPath.title": "Copy Environment Path",
"python-envs.copyProjectPath.title": "Copy Project Path",
Expand All @@ -35,4 +36,4 @@
"python-envs.terminal.activate.title": "Activate Environment in Current Terminal",
"python-envs.terminal.deactivate.title": "Deactivate Environment in Current Terminal",
"python-envs.uninstallPackage.title": "Uninstall Package"
}
}
5 changes: 4 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ export async function activate(context: ExtensionContext): Promise<PythonEnviron
commands.registerCommand('python-envs.setPkgManager', async () => {
await setPackageManagerCommand(envManagers, projectManager);
}),
commands.registerCommand('python-envs.addPythonProject', async (resource) => {
commands.registerCommand('python-envs.addPythonProject', async () => {
await addPythonProjectCommand(undefined, projectManager, envManagers, projectCreators);
}),
commands.registerCommand('python-envs.addPythonProjectGivenResource', async (resource) => {
// Set context to show/hide menu item depending on whether the resource is already a Python project
if (resource instanceof Uri) {
commands.executeCommand('setContext', 'python-envs:isExistingProject', isExistingProject(resource));
Expand Down