Skip to content

Conversation

@Anaminus
Copy link
Contributor

I tried to toggle a variable named index to PascalCase, and found that it did nothing! This is because the variable is neither snake_case nor camelCase, but simply lower case with no separator. This fix treats lower-case-no-separator as camelCase so that it converts to PascalCase, which is more convenient than doing nothing at all.

…riables

When a variable is a single word that is lowercase, it is treated as camelCase so that it toggles to PascalCase, which is more convenient than doing nothing.
@Anaminus
Copy link
Contributor Author

Just considered something: if you're toggling multiple variables, they'll go out of sync:

foo     -> Foo    -> foo    -> Foo
foo_bar -> fooBar -> FooBar -> foo_bar

Obviously, the toggle function can't know the expected state of the single-word variable. At least, not without some complexity that's probably not worth implementing. The question is, might it actually be better to do nothing to the single-word variable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant