mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
* fix: handle YAML parsing edge cases in CustomModesManager - Add BOM (Byte Order Mark) stripping for UTF-8 and UTF-16 - Normalize invisible characters including non-breaking spaces - Replace fancy quotes and dashes with standard characters - Remove zero-width characters that can cause parsing issues - Add comprehensive test coverage for all edge cases This fixes the YAML parsing limitations documented in PR #237 by implementing proper preprocessing before parsing YAML content. * fix: address PR review comments - Fix BOM handling to correctly handle UTF-16 (all BOMs appear as \uFEFF when decoded) - Optimize cleanInvisibleCharacters with single regex pass for better performance - Prevent duplicate error messages by marking errors as already handled - Refactor test file to use mockFsReadFile helper function to reduce duplication - Fix YAML indentation in tests (use spaces instead of tabs) - Add ESLint disable comment for character class warning (regex is correct) * fix: prevent YAML line breaks by setting lineWidth to 0 - Added lineWidth: 0 option to all yaml.stringify() calls - Prevents automatic line wrapping at 80 characters - Improves readability of YAML output for long strings - Applied to CustomModesManager, SimpleInstaller, and migrateSettings * fix: add defaultStringType option to yaml.stringify calls - Added defaultStringType: 'PLAIN' to minimize formatting changes - This helps preserve plain scalars when possible - Works alongside lineWidth: 0 to prevent automatic line wrapping * refactor: extract problematic characters regex as a named constant - Move regex pattern to PROBLEMATIC_CHARS_REGEX static constant - Add comprehensive documentation for each character range - Improves maintainability and makes the pattern reusable * test: add comprehensive edge case tests for YAML parsing - Add test for mixed line endings (CRLF vs LF) - Add test for multiple BOMs in sequence - Add test for deeply nested structures with problematic characters - Ensures robustness across different real-world scenarios * feat(i18n): add error messages for custom modes in multiple languages * fix: update tests to expect i18n keys instead of hardcoded strings - Update CustomModesManager tests to expect translation keys - Fix YAML edge case tests to match new i18n error messages - All tests now pass with the i18n integration * refactor: use strip-bom package and fix error handling - Replace custom stripBOM method with existing strip-bom package - Fix duplicate error handling in parseYamlSafely by returning empty object instead of re-throwing - Addresses review comments from PR #5099 --------- Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com> |
||
|---|---|---|
| .. | ||
| assistant-message | ||
| checkpoints | ||
| condense | ||
| config | ||
| context-tracking | ||
| diff | ||
| environment | ||
| ignore | ||
| mentions | ||
| prompts | ||
| protect | ||
| sliding-window | ||
| task | ||
| task-persistence | ||
| tools | ||
| webview | ||