electron-userland / electron-spellchecker

Implement spellchecking, correctly
MIT License
237 stars 83 forks source link

Some whacky macOS logic in need of ❤? #127

Open bengotow opened 5 years ago

bengotow commented 5 years ago

Hey folks - I've been investigating reports that this module doesn't auto-detect the spellcheck language on macOS, which appears to be true based on some straightforward tests.

I think that the code in electron-spellchecker has been through a lot of iteration and improvement, but there's some whacky stuff going on around automatic language detection. Like this if statement - this else-if scenario will never fire with it ordered after the first case. I'm not sure I understand that comment, but it seems like this isn't quite right.

image

There's also an LRU cache which electron-spellcheck maintains on macOS, but if the NSSpellchecker is switching languages and the cache is never busted, things will just continue to be reported as misspelled:

image