Skip to content

Commit c9e5dea

Browse files
committed
Rename managePackageVersions command
1 parent e654a7c commit c9e5dea

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

api/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4+
import type { Pep440Version } from '@renovatebot/pep440';
45
import {
56
Disposable,
67
Event,
@@ -21,7 +22,6 @@ import {
2122
*/
2223

2324
export type { Pep440Version } from '@renovatebot/pep440';
24-
import type { Pep440Version } from '@renovatebot/pep440';
2525
/**
2626
* The path to an icon, or a theme-specific configuration of icons.
2727
*/
@@ -695,7 +695,7 @@ export interface PackageManager {
695695
clearCache?(): Promise<void>;
696696

697697
/**
698-
* Returns the version of the underlying package management tool (e.g., pip, conda).
698+
* Returns the version of the underlying package management tool (e.g., pip, uv, conda).
699699
* @param environment - The Python environment context.
700700
* @returns A promise that resolves to a {@link Pep440Version} object, or `undefined` if not available.
701701
*/

src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import {
5050
createTerminalCommand,
5151
getPackageCommandOptions,
5252
handlePackageUninstall,
53-
handlePackageVersionManagement,
53+
managePackageVersion,
5454
refreshPackagesCommand,
5555
removeEnvironmentCommand,
5656
removePythonProject,
@@ -299,7 +299,7 @@ export async function activate(context: ExtensionContext): Promise<PythonEnviron
299299
await handlePackageUninstall(context, envManagers);
300300
}),
301301
commands.registerCommand('python-envs.managePackageVersion', async (context: unknown) => {
302-
await handlePackageVersionManagement(context, envManagers);
302+
await managePackageVersion(context, envManagers);
303303
}),
304304
commands.registerCommand('python-envs.set', async (item) => {
305305
await setEnvironmentCommand(item, envManagers, projectManager);

src/features/envCommands.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,11 @@ export async function handlePackageUninstall(context: unknown, em: EnvironmentMa
317317
traceError(`Invalid context for uninstall command: ${typeof context}`);
318318
}
319319

320-
export async function handlePackageVersionManagement(context: unknown, em: EnvironmentManagers) {
320+
/**
321+
* Manages package versions by allowing the user to select from available versions or enter a specific version.
322+
* If available versions can be fetched, a QuickPick is shown. Otherwise, an InputBox is used for free-text version entry.
323+
*/
324+
export async function managePackageVersion(context: unknown, em: EnvironmentManagers) {
321325
if (context instanceof PackageTreeItem || context instanceof ProjectPackage) {
322326
const pkg = context.pkg;
323327
const environment = context.parent.environment;

0 commit comments

Comments
 (0)