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
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@
"command": "python-envs.reportIssue",
"title": "%python-envs.reportIssue.title%",
"category": "Python Environments"
},
{
"command": "python-envs.revealProjectInExplorer",
"title": "%python-envs.revealProjectInExplorer.title%",
"category": "Python Envs",
"icon": "$(folder-opened)"
}
],
"menus": {
Expand Down Expand Up @@ -326,6 +332,10 @@
{
"command": "python-envs.createAny",
"when": "false"
},
{
"command": "python-envs.revealProjectInExplorer",
"when": "false"
}
],
"view/item/context": [
Expand Down Expand Up @@ -395,6 +405,10 @@
"group": "inline",
"when": "view == python-projects && viewItem =~ /.*python-workspace.*/"
},
{
"command": "python-envs.revealProjectInExplorer",
"when": "view == python-projects && viewItem =~ /.*python-workspace.*/"
},
{
"command": "python-envs.uninstallPackage",
"group": "inline",
Expand Down
3 changes: 2 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
"python-envs.createNewProjectFromTemplate.title": "Create New Project from Template",
"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"
"python-envs.uninstallPackage.title": "Uninstall Package",
"python-envs.revealProjectInExplorer.title": "Reveal Project in Explorer"
}
4 changes: 4 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
refreshPackagesCommand,
removeEnvironmentCommand,
removePythonProject,
revealProjectInExplorer,
runAsTaskCommand,
runInDedicatedTerminalCommand,
runInTerminalCommand,
Expand Down Expand Up @@ -356,6 +357,9 @@ export async function activate(context: ExtensionContext): Promise<PythonEnviron
commands.registerCommand('python-envs.copyProjectPath', async (item) => {
await copyPathToClipboard(item);
}),
commands.registerCommand('python-envs.revealProjectInExplorer', async (item) => {
await revealProjectInExplorer(item);
}),
commands.registerCommand('python-envs.terminal.activate', async () => {
const terminal = activeTerminal();
if (terminal) {
Expand Down
9 changes: 9 additions & 0 deletions src/features/envCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -649,3 +649,12 @@ export async function copyPathToClipboard(item: unknown): Promise<void> {
traceVerbose(`Invalid context for copy path to clipboard: ${item}`);
}
}

export async function revealProjectInExplorer(item: unknown): Promise<void> {
if (item instanceof ProjectItem) {
const projectUri = item.project.uri;
await commands.executeCommand('revealInExplorer', projectUri);
} else {
traceVerbose(`Invalid context for reveal project in explorer: ${item}`);
}
}