-
Notifications
You must be signed in to change notification settings - Fork 28
Update venv labeling to show [uv] when uv is available #810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
559ecdf
to
388eb78
Compare
*/ | ||
export let VenvManagerStrings: typeof VenvManagerStringsNoUv | typeof VenvManagerStringsWithUv = VenvManagerStringsNoUv; | ||
|
||
export function setVenvManagerStrings(val: typeof VenvManagerStringsNoUv | typeof VenvManagerStringsWithUv) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
src/managers/builtin/venvManager.ts
Outdated
|
||
readonly name: string; | ||
readonly displayName: string; | ||
displayName: string; // Made mutable to update with uv detection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Remove comment
There was a problem hiding this comment.
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
src/managers/builtin/venvUtils.ts
Outdated
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, | ||
); |
There was a problem hiding this comment.
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?
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, | |
); |
There was a problem hiding this comment.
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>
Current design could be misleading, please check my comment on the original issue: #809 (comment) |
Thanks @Carbaz for pointing that out. That is a great suggestion. |
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.
💡 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.