fix(editor)(#261780): transform UPPER_CASE to PascalCase#262959
fix(editor)(#261780): transform UPPER_CASE to PascalCase#262959hediet merged 3 commits intomicrosoft:mainfrom
Conversation
|
@microsoft-github-policy-service agree |
d2091d8 to
bd9437f
Compare
hiiamkarati
left a comment
There was a problem hiding this comment.
Thanks for this contribution! The PascalCase refactor looks clean and consistent, and I can see that related test cases were updated as well.
A couple of things to double-check before merging:
- Please confirm whether these identifiers are used in any public API/extensions. If yes, renaming them could introduce breaking changes.
- Ensure all references to the old UPPER_CASE values have been updated consistently across the codebase (not just in the files shown here).
- The updated tests cover common cases, but it would be good to verify edge cases (numbers, special characters, mixed casing) are still passing.
Overall, this is a solid improvement in naming consistency 👍
| export class PascalCaseAction extends AbstractCaseAction { | ||
| public static wordBoundary = new BackwardsCompatibleRegExp('[_\\s-]', 'gm'); | ||
| public static wordBoundaryToMaintain = new BackwardsCompatibleRegExp('(?<=\\.)', 'gm'); | ||
| public static upperCaseWordMatcher = new BackwardsCompatibleRegExp('^[A-Z]+$', 'mu'); |
There was a problem hiding this comment.
regex doesnt handle unicode characters. Should this be /^\p{Lu}+$/u ?
|
@Selva-Ganesh-M can you look into the comment and the merge conflicts? Thanks! |
|
@hediet I'm on it. |
- Updated PascalCaseAction to handle ALL_CAPS words correctly - Ensures FOO_BAR -> FooBar and FOO BAR A -> FooBarA - Added tests for ALL_CAPS and mixed cases
- Switch to \p{Lu} with 'mu' flags for broader uppercase detection
- Should better handle non-ASCII scripts beyond basic Latin
- Added representative tests: École, ΩmegaCase, ДомТест
Head branch was pushed to by a user without write access
4f39f5b
bd9437f to
4f39f5b
Compare
|
Hi team, I just wanted to note that I’m still getting used to rebasing and pushing from a fork, so I may have caused some confusion with the force-push. I appreciate your patience. This PR includes:
Thanks for reviewing and for your guidance! |
Improve PascalCase conversion with Unicode support
* fix(editor)(#261780): transform UPPER_CASE to PascalCase - Updated PascalCaseAction to handle ALL_CAPS words correctly - Ensures FOO_BAR -> FooBar and FOO BAR A -> FooBarA - Added tests for ALL_CAPS and mixed cases * Improve PascalCase conversion with Unicode support - Switch to \p{Lu} with 'mu' flags for broader uppercase detection - Should better handle non-ASCII scripts beyond basic Latin - Added representative tests: École, ΩmegaCase, ДомТест
fixes #261780
The fix supports the new expectation:
while keeping the current behavior intact:
Added unit tests to cover both cases.
reviews and suggestions are welcome.