Improved vscode user-defined scope settings#17
Conversation
kubrickcode
commented
Sep 16, 2025
- Previously, the workspace scope was always set, so the user's .vscode/settings.json file had to be constantly modified, which was inconvenient.
- Now, users can select and set the scope depending on the situation.
|
/gemini review |
There was a problem hiding this comment.
Summary of Changes
Hello @kubrickcode, 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 improves the flexibility of managing VS Code quick command button configurations. By introducing the ability to choose between workspace and global settings, users are no longer constrained to project-specific configurations, allowing for more personalized and persistent command setups across different projects. This change enhances user control and streamlines the configuration process.
Highlights
- User-Defined Scope for Settings: Users can now select whether to save their quick command button configurations to workspace-specific settings (
.vscode/settings.json) or global user settings, addressing the previous limitation where configurations were always saved to the workspace. - New Toggle Command: A new command,
quickCommandButtons.toggleConfigurationTarget, has been introduced, allowing users to easily switch their configuration save target between workspace and global scopes. - Configuration Target Setting: A new setting,
quickCommandButtons.configurationTarget, has been added topackage.jsonto store the user's preferred configuration scope, defaulting to 'workspace'. - UI Integration: The Quick Commands configuration UI now includes a visual indicator and a toggle button to manage and display the current save location (Workspace or Global).
Using Gemini Code Assist
The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable feature, allowing users to select whether to save their command configurations at the workspace or global level. The implementation is well-executed across the extension backend and the webview frontend, with thoughtful additions like backward compatibility for configuration data and updated tests. My review focuses on two key areas for improvement: adding robust error handling to a new command and refactoring duplicated code to enhance maintainability. Overall, this is a solid contribution that improves the extension's flexibility.
There was a problem hiding this comment.
Code Review
This pull request introduces a great new feature allowing users to choose between workspace and global settings for their command buttons. The implementation is solid, covering both the extension backend and the webview UI. I have a few suggestions, mainly around reducing code duplication and using constants for configuration keys, which will improve the maintainability of the code.
| const toggleConfigurationTargetCommand = vscode.commands.registerCommand( | ||
| "quickCommandButtons.toggleConfigurationTarget", | ||
| async () => { | ||
| const config = vscode.workspace.getConfiguration("quickCommandButtons"); | ||
| const currentTarget = config.get<string>( | ||
| "configurationTarget", | ||
| "workspace" | ||
| ); | ||
| const newTarget = currentTarget === "workspace" ? "global" : "workspace"; | ||
|
|
||
| await config.update( | ||
| "configurationTarget", | ||
| newTarget, | ||
| vscode.ConfigurationTarget.Global | ||
| ); | ||
|
|
||
| const targetMessage = | ||
| newTarget === "global" | ||
| ? "user settings (shared across all projects)" | ||
| : "workspace settings (project-specific)"; | ||
| vscode.window.showInformationMessage( | ||
| `Configuration target changed to: ${targetMessage}` | ||
| ); | ||
| } | ||
| ); |
There was a problem hiding this comment.
The logic inside this command to update the configurationTarget and show a notification is also implemented in _updateConfigurationTarget within src/extension/src/webview-provider.ts. This is another instance of duplicated code.
This logic should be extracted into a single, centralized function (e.g., in a new config-manager.ts or similar utility file). This function would handle updating the setting at the correct scope (Global in this case) and showing the notification. It could then be called from both the command registration in main.ts and from the webview provider, ensuring consistent behavior and easier maintenance.
c528a95 to
81bc968
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a great new feature allowing users to choose between workspace and global scope for their command button configurations. The implementation is well-structured, with the introduction of a ConfigManager to centralize configuration logic and a refactoring of the webview message handling. My feedback focuses on improving the error handling strategy to avoid showing redundant error messages to the user, which will enhance the user experience.
81bc968 to
d076014
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a great improvement, introducing the ability for users to select the configuration scope (workspace or global). The code is well-structured, especially with the addition of the ConfigManager to centralize configuration logic.
My main concern is the lack of unit tests for the new ConfigManager. This class contains critical logic for updating settings and providing user feedback, including error messages. Adding tests for ConfigManager would significantly improve the robustness of this new feature.
I've also left a few suggestions for improving code clarity and testing practices. Overall, this is a solid contribution.
- Previously, the workspace scope was always set, so the user's .vscode/settings.json file had to be constantly modified, which was inconvenient. - Now, users can select and set the scope depending on the situation.
d076014 to
177947d
Compare