krasa / StringManipulation

IntelliJ plugin - https://plugins.jetbrains.com/plugin/2162
Apache License 2.0
698 stars 81 forks source link

snake_case to camelCase ignoring whitespace #160

Closed bedomon closed 2 years ago

bedomon commented 2 years ago

Describe the bug

When attempting to convert a whole file with snake case string to camel case string, it convert the whole line in camel case instead of the word in snake case :

Example :

String some_snake_case int another_snake_case

go to

StringSomeSnakeCase intAnotherSnakeCase

instead of

String someSnakeCase int anotherSnakeCase

To Reproduce Having a file full of snake_case string use the option from menu : Edit -> String Manipulation -> switch case -> snake_case / camelCase

Environment : Tests have been made in intelliJ ultimate and rubyMine (both last version)

krasa commented 2 years ago

Yes, it converts everything selected. Autodetection of suitable substrings would be problematic.

krasa commented 2 years ago

I would recommend using Main Menu | Edit | Find | Select All Occurrences.

krasa commented 2 years ago

This would help you: Action 'Select All Occurrences For All Carets' was added, bind at Keymap see https://youtrack.jetbrains.com/issue/IDEA-283466

Implementing what you want is not feasible.