Skip to content
Open
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
32 changes: 32 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@
"icon": "$(gear)",
"when": "config.python.useEnvironmentsExtension != false"
},
{
"command": "python-envs.addFolderToPythonPath",
"title": "%python-envs.addFolderToPythonPath.title%",
"category": "Python",
"icon": "$(new-folder)",
"when": "config.python.useEnvironmentsExtension != false"
},
{
"command": "python-envs.openPythonPathFile",
"title": "%python-envs.openPythonPathFile.title%",
"category": "Python",
"icon": "$(file-text)",
"when": "config.python.useEnvironmentsExtension != false"
},
{
"command": "python-envs.setPkgManager",
"title": "%python-envs.setPkgManager.title%",
Expand Down Expand Up @@ -280,6 +294,10 @@
],
"menus": {
"commandPalette": [
{
"command": "python-envs.addFolderToPythonPath",
"when": "config.python.useEnvironmentsExtension != false"
},
{
"command": "python-envs.refreshAllManagers",
"when": "false"
Expand Down Expand Up @@ -405,6 +423,15 @@
"command": "python-envs.refreshPackages",
"when": "view == env-managers && viewItem =~ /.*pythonEnvironment.*/"
},
{
"command": "python-envs.addFolderToPythonPath",
"group": "inline",
"when": "view == env-managers && viewItem =~ /.*pythonEnvironment.*/"
},
{
"command": "python-envs.openPythonPathFile",
"when": "view == env-managers && viewItem =~ /.*pythonEnvironment.*/"
},
{
"command": "python-envs.packages",
"group": "inline",
Expand Down Expand Up @@ -495,6 +522,11 @@
"command": "python-envs.addPythonProjectGivenResource",
"group": "inline",
"when": "explorerViewletVisible && resourceExtname == .py"
},
{
"command": "python-envs.addFolderToPythonPath",
"group": "inline",
"when": "explorerViewletVisible && explorerResourceIsFolder"
}
],
"editor/title/run": [
Expand Down
3 changes: 3 additions & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"python-envs.terminal.revertStartupScriptChanges.title": "Revert Shell Startup Script Changes",
"python-envs.reportIssue.title": "Report Issue",
"python-envs.setEnvManager.title": "Set Environment Manager",
"python-envs.addFolderToPythonPath.title": "Add Folder to Python PATH",
"python-envs.addFolderToPythonPathForEnv.title": "Add Folder to Python PATH",
"python-envs.openPythonPathFile.title": "Open Python PATH File",
"python-envs.setPkgManager.title": "Set Package Manager",
"python-envs.addPythonProject.title": "Add Python Project",
"python-envs.addPythonProjectGivenResource.title": "Add as Python Project",
Expand Down
8 changes: 8 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import {
setEnvironmentCommand,
setEnvManagerCommand,
setPackageManagerCommand,
addFolderToPythonPathCommand,
openPythonPathFileCommand,
} from './features/envCommands';
import { PythonEnvironmentManagers } from './features/envManagers';
import { EnvVarManager, PythonEnvVariableManager } from './features/execution/envVariableManager';
Expand Down Expand Up @@ -361,6 +363,12 @@ export async function activate(context: ExtensionContext): Promise<PythonEnviron
commands.registerCommand('python-envs.copyProjectPath', async (item) => {
await copyPathToClipboard(item);
}),
commands.registerCommand('python-envs.addFolderToPythonPath', async (item) => {
await addFolderToPythonPathCommand(item, envManagers);
}),
commands.registerCommand('python-envs.openPythonPathFile', async (item) => {
await openPythonPathFileCommand(item, envManagers);
}),
commands.registerCommand('python-envs.revealProjectInExplorer', async (item) => {
await revealProjectInExplorer(item);
}),
Expand Down
Loading