wmaurer / vscode-change-case

Change Case Extension for Visual Studio Code
MIT License
351 stars 37 forks source link

"Copy case to clipboard" commands #37

Open ghost opened 3 years ago

ghost commented 3 years ago

I often find myself wanting to just copy something in a different case without changing it. One use case is for creating files: suppose I have a value named HelloController and I'm going to create the file controllers/hello_controller.ex. I would just copy the name of the value in snake case, leaving it unchanged.

SAKryukov commented 11 months ago

Good idea! Thank you. —SA

SAKryukov commented 11 months ago

Come to think about it, not only is your idea excellent, but worth implementing. As a matter of fact, I've just published the solution: Yet Another Change Case

This implementation is very different from similar extensions. I rationalized the requirements, keeping in mind the life cycle of textual expressions, and how they are converted to programming identifiers and visa versa. For example, I implemented splitting by case, repeating the last operation, and an optional clipboard. This is really what we need to use. Also, the input is more structured and clear.

Also, I looked through several extensions and found a lot of unacceptable bugs. The most typical one is improper tracking of the current UI session state, so the commands remain accessible when there is no active editor, and that leads to an exception. Hopefully, it all works correctly.

Hope you enjoy it. Thank you for the good idea.
—SA