Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 8, 2025

This PR implements automatic detection of uv availability and updates the venv manager display name to show "venv [uv]" . Also fixes various other localized messages to include uv and clarify this to users
Fixes #809.

  • Initial implementation of uv detection and display name updates
  • Add uv-specific strings to localized messages
  • Update venv creation progress messages to include uv indicator
  • Address code review feedback:
    • Remove explanatory comment from venvManager.ts
    • Simplify progress title creation in venvUtils.ts using template literals
  • Final testing and validation

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] update labeling when uv is used Update venv labeling to show [uv] when uv is available Sep 8, 2025
@Copilot Copilot AI requested a review from eleanorjboyd September 8, 2025 19:04
Copilot finished work on behalf of eleanorjboyd September 8, 2025 19:04
Copilot AI and others added 3 commits September 8, 2025 13:16
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
@eleanorjboyd eleanorjboyd force-pushed the copilot/update-venv-label-for-uv branch from 559ecdf to 388eb78 Compare September 8, 2025 20:17
@eleanorjboyd eleanorjboyd marked this pull request as ready for review September 8, 2025 20:30
@vs-code-engineering vs-code-engineering bot added this to the September 2025 milestone Sep 8, 2025
*/
export let VenvManagerStrings: typeof VenvManagerStringsNoUv | typeof VenvManagerStringsWithUv = VenvManagerStringsNoUv;

export function setVenvManagerStrings(val: typeof VenvManagerStringsNoUv | typeof VenvManagerStringsWithUv) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karthiknadig can you just review this to make sure this structure of setting strings makes sense and follows good coding practices

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually looks a bit weird. There are several string duplicates.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karthiknadig moved to duplicates to a diff function so there shouldn't be repeats. Lmk your thoughts


readonly name: string;
readonly displayName: string;
displayName: string; // Made mutable to update with uv detection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Remove comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the comment as requested. The code is now cleaner without the explanatory comment. Commit: bb30e4f

Comment on lines 309 to 319
const progressTitle = useUv
? l10n.t(
'Creating virtual environment named {0} using python version {1} [uv].',
path.basename(envPath),
basePython.version,
)
: l10n.t(
'Creating virtual environment named {0} using python version {1}.',
path.basename(envPath),
basePython.version,
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot may be something like this, more compact?

Suggested change
const progressTitle = useUv
? l10n.t(
'Creating virtual environment named {0} using python version {1} [uv].',
path.basename(envPath),
basePython.version,
)
: l10n.t(
'Creating virtual environment named {0} using python version {1}.',
path.basename(envPath),
basePython.version,
);
const progressTitle = l10n.t(
'Creating virtual environment named {0} using python version {1} {useUv? "[uv]": ""}.',
path.basename(envPath),
basePython.version,
);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented your suggestion for a more compact approach using a single l10n.t() call with conditional text. This eliminates the duplicate string and makes the code cleaner. Commit: bb30e4f

…ssage

Co-authored-by: karthiknadig <3840081+karthiknadig@users.noreply.github.com>
@Copilot Copilot AI requested a review from karthiknadig September 10, 2025 17:03
Copilot finished work on behalf of karthiknadig September 10, 2025 17:03
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Sep 10, 2025
@Carbaz
Copy link

Carbaz commented Sep 11, 2025

Current design could be misleading, please check my comment on the original issue: #809 (comment)

@karthiknadig
Copy link
Member

Thanks @Carbaz for pointing that out. That is a great suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update labeling when uv is used

4 participants