-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Feat/extension uninstall #12882
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?
Feat/extension uninstall #12882
Conversation
- Add a new `uninstall` subcommand to the `/extensions` command. - The `uninstall` subcommand allows users to remove installed extensions. - Convert `extensionsCommand.ts` to `extensionsCommand.tsx` to support JSX for the confirmation prompt. - Add tests for the new `uninstall` subcommand.
Summary of ChangesHello @JayadityaGit, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the extension management capabilities within the CLI by introducing a dedicated uninstall feature. It streamlines the process of removing unwanted extensions, improving the overall user experience through intuitive prompts, clear error messages, and a more logical arrangement of extension-related commands. This change makes the CLI a more complete and user-friendly tool for managing installed extensions. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a valuable uninstall subcommand for managing extensions, which is a great addition. The implementation is well-structured, including a confirmation prompt and error handling. The accompanying tests cover the primary functionality. However, I've identified two high-severity issues related to case-sensitivity in how extension names are matched and suggested for completion. These could lead to user frustration when an extension isn't found despite being installed. Addressing these points will significantly improve the robustness and user-friendliness of this new feature.
| return; | ||
| } | ||
|
|
||
| const extension = extensions.find((ext) => ext.name === trimmedArgs); |
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.
The extension lookup is case-sensitive, while the underlying extensionManager.uninstallExtension method performs a case-insensitive search. This discrepancy can lead to a "not found" error for an extension that exists but is specified with different casing. To ensure consistent and predictable behavior, the lookup here should also be case-insensitive.
const extension = extensions.find(
(ext) => ext.name.toLowerCase() === trimmedArgs.toLowerCase(),
);
| ? listExtensions(context.services.config) | ||
| : []; | ||
| const extensionNames = extensions.map((ext) => ext.name); | ||
| return extensionNames.filter((name) => name.startsWith(partialArg)); |
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.
The completion filtering for extension names is case-sensitive. For a better user experience and for consistency with a case-insensitive command argument, the completion logic should also be case-insensitive. This will help users discover extensions via tab-completion even if they don't remember the exact casing.
return extensionNames.filter((name) => name.toLowerCase().startsWith(partialArg.toLowerCase()));
Summary
This PR adds an
uninstallsubcommand to the/extensionscommand, enabling users to remove extensions directly from the CLI. It also improves the UX by reordering extension subcommands based on usage frequency for better discoverability.Details
/extensions uninstall <extension-name>with a confirmation promptlist→explore→restart→update→uninstallRelated Issues
Enhances the overall extension-management workflow.
How to Validate
/extensions uninstallto view usage info and the installed extensions list/extensions uninstall <extension-name>and confirm the prompt/extensions list/extensions uninstall non-existent-extension/extensionswith tab completionPre-Merge Checklist
Updated relevant documentation/README (if needed)
Added or updated tests
Noted breaking changes — None
Validated on required platforms/methods:
macOS
Windows
Linux
Add /extensions uninstall Command for Direct Extension Removal via CLI #12894