Skip to content

fix(editor)(#261780): transform UPPER_CASE to PascalCase#262959

Merged
hediet merged 3 commits intomicrosoft:mainfrom
Selva-Ganesh-M:fix/#261780
Oct 14, 2025
Merged

fix(editor)(#261780): transform UPPER_CASE to PascalCase#262959
hediet merged 3 commits intomicrosoft:mainfrom
Selva-Ganesh-M:fix/#261780

Conversation

@Selva-Ganesh-M
Copy link
Contributor

fixes #261780

The fix supports the new expectation:

FOO_BAR → FooBar

FOO BAR A → FooBarA

while keeping the current behavior intact:

parseHTMLString → ParseHTMLString,

audioConverter.convertM4AToMP3() → AudioConverter.ConvertM4AToMP3()

Added unit tests to cover both cases.

reviews and suggestions are welcome.

@Selva-Ganesh-M
Copy link
Contributor Author

@microsoft-github-policy-service agree

Copy link

@hiiamkarati hiiamkarati left a comment

Choose a reason for hiding this comment

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

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:

  1. Please confirm whether these identifiers are used in any public API/extensions. If yes, renaming them could introduce breaking changes.
  2. Ensure all references to the old UPPER_CASE values have been updated consistently across the codebase (not just in the files shown here).
  3. 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 👍

hediet
hediet previously approved these changes Sep 8, 2025
dbaeumer
dbaeumer previously approved these changes Sep 8, 2025
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');
Copy link

Choose a reason for hiding this comment

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

regex doesnt handle unicode characters. Should this be /^\p{Lu}+$/u ?

@hediet
Copy link
Member

hediet commented Sep 11, 2025

@Selva-Ganesh-M can you look into the comment and the merge conflicts? Thanks!

@Selva-Ganesh-M
Copy link
Contributor Author

@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, ДомТест
auto-merge was automatically disabled September 11, 2025 16:09

Head branch was pushed to by a user without write access

@Selva-Ganesh-M Selva-Ganesh-M dismissed stale reviews from dbaeumer and hediet via 4f39f5b September 11, 2025 16:09
@Selva-Ganesh-M
Copy link
Contributor Author

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:

  • Switch to \p{Lu} with 'mu' flags for broader uppercase detection

  • Better handling of non-ASCII scripts beyond basic ones

  • Added tests: École, ΩmegaCase, ДомТест

  • Handles ALL_CAPS and mixed-case words

Thanks for reviewing and for your guidance!

Improve PascalCase conversion with Unicode support
@hediet hediet modified the milestones: September 2025, October 2025 Sep 30, 2025
@EFanZh
Copy link
Contributor

EFanZh commented Oct 1, 2025

For acronyms, different programming languages have different styles:

Can we support both styles?

@hediet hediet merged commit 0267af2 into microsoft:main Oct 14, 2025
17 checks passed
pwang347 pushed a commit that referenced this pull request Oct 14, 2025
* 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, ДомТест
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Nov 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to transform UPPER_CASE to PascalCase

7 participants