Bug 576417 - Toggle between upper/lower camelCase and snakeCase
Summary: Toggle between upper/lower camelCase and snakeCase
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.22   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-04 03:31 EDT by Frank Benoit CLA
Modified: 2022-03-05 01:57 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.