streetsidesoftware / cspell

A Spell Checker for Code!
https://cspell.org
MIT License
1.26k stars 103 forks source link

Offer camelCase suggestions for spelling corrections #4928

Open janice143 opened 1 year ago

janice143 commented 1 year ago

this plugin provides the ability to check camelCase words by splitting it into a list of known English words, such as

camelCase -> camel case HTMLInput -> html input – Notice that the I is associated with Input and not HTML snake_case_words -> snake case words camel2snake -> camel snake – (the 2 is ignored)

This means any two or more words can be put together to make a camelCase new word which should become a suggestion spelling in the suggestion list.

so, can you add a feature to support camelCase word suggestion for speling correstions?

Jason3S commented 1 year ago

@janice143,

Would you give some more examples? I'm trying to understand exactly what you are looking for.

Are you hoping that camelcase will result the in the suggestion of camelCase? Or do you already have a camel case word in your dictionary and want it to be suggested?

janice143 commented 1 year ago

Yes, I'm hoping camelcase results will be suggestions for correction without manually adding them in the dictionary. Most of time when I'm coding, I tend to make this kind of spelling mistake that the word is supposed to be in cammel case that can pass your plugin. Such as,

setloading in the following code snippet, which should be correct as setLoading

const [loading, setloading] = useState();

or a common variable datasource, which should be fix as dataSource.

It would be great if the correct camel case style could be included in the list of fixing suggestions.

I read your document about how the plugin handle the camelCase ( shown as the following pic), I thougth since you can identify misspelled camel case words forwardly, is it possible to add a feature to reversely correct words to the camel case spelling.