-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Removed hardcoded filenames to GlobalFileNames constants. #1904
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
Removed hardcoded filenames to GlobalFileNames constants. #1904
Conversation
🦋 Changeset detectedLatest commit: a2553e4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
We could add function to the |
Yeah that makes sense to me. I'd rather not make people figure out how to move files around manually within the extension directories. Thanks! |
- Implement migrateSettings function to rename legacy settings files to new format - Migrate cline_custom_modes.json to new custom modes filename - Migrate cline_mcp_settings.json to new MCP settings filename - Add TODO to remove migration code in September 2025 (6 months after implementation) - Make activate function async to support migration on startup
…ub.com/StevenTCramer/Roo-Code into Cramer/2025-03-22/custom-modes-setting
mrubens
left a 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.
This looks good, and I think we could use this structure for migrating from .clinerules to .roorules too (which I have been waiting to do for a while!).
Only case that's somewhat on my mind is if someone updates to this version and then decided to go back to an earlier version, they might wonder what happened to their modes and MCP servers. Not sure there's any way around that though?
|
@mrubens I can add that to this one or do another your call. |
- Extract migrateSettings function from extension.ts to src/utils/migrateSettings.ts - Update extension.ts to import and use the extracted function - Update tests to use the real implementation - Improve dependency injection by passing outputChannel as parameter - Enhance maintainability by isolating temporary migration code (to be removed Sept 2025)
|
I pulled the MigrateSettings out into its own file in the util directory so we don't clutter up the main @mrubens I did a search and |
Yeah sounds good. That one is also touching files that the user might have checked into or ignored in version control, so we might want some visible messaging around what's happening. |
Context
Removed hardcoded filenames from CustomModesManager and moved them to GlobalFileNames constants. This makes the code more maintainable by centralizing filename definitions and removes product-specific prefixes from filenames.
Implementation
customModes: "custom_modes.json"to the GlobalFileNames object in src/shared/globalFileNames.tsThis approach makes the code more maintainable by centralizing the filename in the GlobalFileNames constant file, making it easier to change in the future if needed. It also removes product-specific prefixes from filenames, making them more generic.
How to Test
Get in Touch
I'm available on the Roo Code Discord as @StevenTCramer
Considerations
This change affects two configuration files:
Users with existing custom modes or MCP configurations will need to be informed through release notes about these filename changes. They can manually rename their existing files to preserve their configurations:
cline_custom_modes.jsontocustom_modes.jsoncline_mcp_settings.jsontomcp_settings.jsonThese files are typically located in the VSCode global storage path under the Roo extension settings directory.
Important
Centralized filename definitions in
GlobalFileNamesand removed product-specific prefixes inCustomModesManager.tsand tests.cline_custom_modes.jsonwithGlobalFileNames.customModesinCustomModesManager.ts.cline_mcp_settings.jsontomcp_settings.jsoninglobalFileNames.ts.CustomModesManager.test.tsto useGlobalFileNames.customModesinstead of hardcoded filename.customModes: "custom_modes.json"toGlobalFileNamesinglobalFileNames.ts.This description was created by
for 3b351b7. It will automatically update as commits are pushed.