小能豆

rename to upper case in Eclipse IDE

javascript

I would like in Eclipse IDE to rename a variable name / constant / enum type just by switching the case without typing the variable name again.

I am refactoring a long enum with all its types in lower case, and I would like to rename them to upper case without wasting much time typing them again.

I suppose that should be a way to do this, but I do not figure out.


阅读 70

收藏
2023-11-20

共1个答案

小能豆

In Eclipse IDE, you can easily switch the case of a variable name, constant, or enum type without retyping it. Follow these steps:

  1. Place the Cursor on the Identifier:

  2. Place the cursor on the variable name, constant, or enum type that you want to change the case of.

  3. Use the Appropriate Shortcut:

  4. Use the appropriate keyboard shortcut to switch the case:

    • For Windows/Linux: Ctrl + Shift + X
    • For macOS: Cmd + Shift + X

This keyboard shortcut toggles between uppercase and lowercase for the selected text.

  1. Repeat if Necessary:

  2. If you have multiple occurrences of the identifier and you want to change all of them, you can use the “Toggle Case” action multiple times or use the “Toggle Case” action for the entire word at once.

These steps should help you quickly switch the case of an identifier without retyping it. Keep in mind that this feature works not only for enum types but also for any other variable names, constants, or text selections in your code.

2023-11-20