atom / spell-check

Spell check Atom package
MIT License
204 stars 121 forks source link

Add support for camelCase. #91

Open pepjo opened 8 years ago

pepjo commented 8 years ago

Spell check camelCased words.

That would be great for writing javascript. If I don't remember wrongly, webstorm already does that.

benweet commented 8 years ago

+1

m-schrepel commented 8 years ago

+1

skydivingwill commented 8 years ago

+1

shdblowers commented 8 years ago

+1

flplv commented 8 years ago

+1

artemjackson commented 8 years ago

+1

savbace commented 8 years ago

+1

vladimir-djokic commented 8 years ago

+1 Really needed for any kind of programming + spell-checking. Most of the multi-word variables are marked as misspelled.

Vahanerevan commented 8 years ago

+1

MatsMaker commented 8 years ago

+1

tijmenvangurp commented 8 years ago

+1

Dennislampert commented 7 years ago

Made a quick fix for it. Not super sexy but it helps me. I probably won't do more updates on it. But feel free to fork or make pr! spellcheck snake and camel case

kankaristo commented 7 years ago

@Dennislampert, isn't it snake_case, not sneak_case?

Dennislampert commented 7 years ago

Thanks! Your right 👍

sparcut commented 6 years ago

@kankaristo http://lmgtfy.com/?t=i&q=snek 😏

archcorsair commented 6 years ago

+1 👍 Yes please! I use a spellcheck package in VScode that checks camelCase, which is extremely useful for javascript! I would love to see the same functionality in Atom

artemjackson commented 6 years ago

I would suggest just to go to VS Code :)

dmoonfire commented 6 years ago

I wouldn't go that far. The current hangup on camel case is that we pass the entire buffer to Huspell instead of tokenizing on the Atom side. There has been a number of attempts to do the tokenization on Atom's side however it got stalled by Unicode. The tokenization rules there are... complicated to say the least but something we would have to solve in addition to doing this/pascal/snake/underscore case.

Doable, just mentioning why I don't think it's trivial.

joshcoast commented 5 years ago

Man, this was first posted 4 years ago. :( Doesn't look like it's going to happen?

dmoonfire commented 5 years ago

I think it is still a possibility. spell-check uses various system libraries underneath them, none that handle camel, Pascal, or the other cases, we might be able to let one of the plugin checkers have access to the rest of the registered checkers to do some sort of reeentrant callback? That way, we could implement a spell-check-camel-case.

At the moment, I have a few too many open spell-check issues I'm working on so I haven't been able to get to this one yet.

wbt commented 5 years ago

spell-check could use various tokenizers before passing a token to the underlying system/other spell-checking library. It could do something like this:

  1. Try the token as currently parsed. If it passes, mark the whole token as passed.
  2. Split by any letter that isn't [a-z][A-Z] or some appropriate subset of characters, e.g. split on punctuation. Tokens that pass at this point are marked as passing.
  3. For tokens that are still failing, iterate over the token and split to a new one just before any change in case. Try those tokens in the existing spell-check library.
  4. Portions that still fail, get marked as a potential spelling mistake.

It might also be helpful to interact with the syntax formatter so that e.g. code formatted as a control word is ignored by the spell checker.

wbt commented 5 years ago

Also, as a point of comparison the Code Spell Checker for Visual Studio likely referenced above, "A basic spell checker that works well with camelCase code," is listed as having >2.5M downloads, and being among the most popular linters.