pranshuagrawal / vscode-toggle-case Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
On linux, the hot key is control-m. This is not included in the description on vccode marketplace.
vscode-toggle-case/src/utilities.ts
Line 118 in 84cc60b
It would great if per language (file extension) settings were available.
For example .py would have CONSTANT_CASE, snake_case
.c, .cpp, c++, .h, .hpp, h++: camelCase, CONSTANT_CASE,
.js: camelCase, PascalCase (aka UpperCamelCase)
When the word is selected/highlighted using a keyboard (in example below option+shift+left), the toggle transform command deletes whole word.
It works when I use my mouse to select/highlight the word and toggle case.
Hi @pranshuagrawal !
I've just hitted following case while using your extension:
When you're toggling some simple single word without any "dividable parts/separators", like console
for example.
Then, there are only 3 possible case-variations for that word:
console
(lowercase)
Console
(capitalized)
CONSOLE
(uppercase)
So, is it possible to make check (after each case transformation) if transformed string is different from the original input?
When resulting string is not different (so no transformation has been actually done) then move to the next transformation in the list and apply it - until any change is made (or transformation list reaches it's end - to prevent infinite loop).
As a result - only 3 variations (described above) will be resulted while toggling the case (because dot case, header case, kebab case and others cases (which are using "word separation") will be skipped by the check).
Simply said - after this change, only transformations which would have any effect will be actually used/cycled. Does it makes sense to you @pranshuagrawal โ
The Title Case transform doesn't seem to work: it changes text to Sentence case instead of title case. Title Case should capitalize the first letter of each word when words are separated by spaces. I think perhaps this extension is not coded to manage text with spaces in it, but is intended for string or variable names?
Here is a sample text that I tried:
This is a sentence with only one capital letter.
And here is the output when I use the Transform to Title Case:
This is a sentence with only one capital letter.
Here is another sample:
here's a phrase I want to transform to Title Case
And here is the Title Case output:
Here's a phrase i want to transform to title case
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.