Skip to content

Commit

Permalink
Display user friendly path when displaying create environment notific…
Browse files Browse the repository at this point in the history
…ation (#20387)

Closes #19934
  • Loading branch information
Kartik Raj authored Dec 15, 2022
1 parent e72ca97 commit 07e334a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/client/extensionActivation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
IExtensions,
IInterpreterPathService,
IOutputChannel,
IPathUtils,
} from './common/types';
import { noop } from './common/utils/misc';
import { DebuggerTypeName } from './debugger/constants';
Expand Down Expand Up @@ -102,7 +103,8 @@ export function activateFeatures(ext: ExtensionState, _components: Components):
const interpreterPathService: IInterpreterPathService = ext.legacyIOC.serviceContainer.get<IInterpreterPathService>(
IInterpreterPathService,
);
registerCreateEnvironmentFeatures(ext.disposables, interpreterQuickPick, interpreterPathService);
const pathUtils = ext.legacyIOC.serviceContainer.get<IPathUtils>(IPathUtils);
registerCreateEnvironmentFeatures(ext.disposables, interpreterQuickPick, interpreterPathService, pathUtils);
}

/// //////////////////////////
Expand Down
5 changes: 3 additions & 2 deletions src/client/pythonEnvironments/creation/createEnvApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { ConfigurationTarget, Disposable } from 'vscode';
import { Commands } from '../../common/constants';
import { IDisposableRegistry, IInterpreterPathService } from '../../common/types';
import { IDisposableRegistry, IInterpreterPathService, IPathUtils } from '../../common/types';
import { registerCommand } from '../../common/vscodeApis/commandApis';
import { IInterpreterQuickPick } from '../../interpreter/configuration/types';
import { getCreationEvents, handleCreateEnvironmentCommand } from './createEnvironment';
Expand Down Expand Up @@ -48,6 +48,7 @@ export function registerCreateEnvironmentFeatures(
disposables: IDisposableRegistry,
interpreterQuickPick: IInterpreterQuickPick,
interpreterPathService: IInterpreterPathService,
pathUtils: IPathUtils,
): void {
disposables.push(
registerCommand(
Expand All @@ -64,7 +65,7 @@ export function registerCreateEnvironmentFeatures(
onCreateEnvironmentExited(async (e: CreateEnvironmentResult | undefined) => {
if (e && e.path) {
await interpreterPathService.update(e.uri, ConfigurationTarget.WorkspaceFolder, e.path);
showInformationMessage(`${CreateEnv.informEnvCreation} ${e.path}`);
showInformationMessage(`${CreateEnv.informEnvCreation} ${pathUtils.getDisplayName(e.path)}`);
}
}),
);
Expand Down

0 comments on commit 07e334a

Please sign in to comment.