Bug 576417

Summary: Toggle between upper/lower camelCase and snakeCase
Product: [Eclipse Project] Platform Reporter: Frank Benoit <frank.rene.benoit>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: mistria, rolf.theunissen
Version: 4.22   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=543283
Whiteboard:

Description Frank Benoit CLA 2021-10-04 03:31:30 EDT
In many projects there are coding rule and checks to enforce them. During refactorings, it happens that e.g. a field is changed to be 'static final' which also implies that the name must be changed from lower camel to MACRO_CASE.

When doing this for many items, this is very annoying. I can use "to upper case" but then I need to manually place the underscores.

I wish, I had a short-cut that lets me switch around the case:
lowerCamelCase (1) -> UpperCamelCase (2) -> lower_snake_case (3) -> UPPER_SNAKE_CASE (4) -> lowerCamelCase ...

Word boundaries are always kepts, hence cycling is possible. If there would be a simple all-upper-case, this would lose the boundaries.

For a single word lower case word, that might be a bit challenging, because (1) and (3) are the same word. Here the mechanism need to remember its last state, so it can decide what is next for this case.
Comment 1 Frank Benoit CLA 2021-10-04 03:49:23 EDT
The lower_snake_case I am not sure if this is needed. At least in Java projects, I did never use it. In CDT C/C++ this is useful. So this might be a preference setting, if this is part of the cycle.
Comment 2 Rolf Theunissen CLA 2021-10-05 10:50:10 EDT
Similar functionality is provided by AnyEdit Tools:
https://marketplace.eclipse.org/content/anyedit-tools

It adds convert menu, and shortcuts for conversions.