Skip to content

Improved vscode user-defined scope settings#17

Merged
kubrickcode merged 1 commit intomainfrom
scope-configuration
Sep 16, 2025
Merged

Improved vscode user-defined scope settings#17
kubrickcode merged 1 commit intomainfrom
scope-configuration

Conversation

@kubrickcode
Copy link
Owner

  • 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.

@kubrickcode kubrickcode self-assigned this Sep 16, 2025
@kubrickcode
Copy link
Owner Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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 to package.json to 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

  1. 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.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 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.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 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.

Comment on lines 70 to 83
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}`
);
}
);

Choose a reason for hiding this comment

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

medium

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.

@kubrickcode
Copy link
Owner Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 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.

@kubrickcode
Copy link
Owner Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 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.
@kubrickcode kubrickcode merged commit c58d4d4 into main Sep 16, 2025
2 checks passed
@kubrickcode kubrickcode deleted the scope-configuration branch October 6, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The problem of unconditionally modifying settings.json in the vscode folder when changing settings

1 participant