Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@felixrieseberg/spellchecker CheckSpelling not working #147

Open
jeremyspiegel opened this issue May 29, 2019 · 2 comments
Open

@felixrieseberg/spellchecker CheckSpelling not working #147

jeremyspiegel opened this issue May 29, 2019 · 2 comments

Comments

@jeremyspiegel
Copy link

This package (electron-spellchecker) depends on @felixrieseberg/spellchecker. That npm package points to https://github.com/atom/node-spellchecker as its git repo, but it seems that @felixrieseberg/spellchecker is diverged from that code (@felixrieseberg/spellchecker is at version 4.0.8 but atom/node-spellchecker is at 3.5.3). I can't find a public place for the source for @felixrieseberg/spellchecker.

In the switch from using @nornagon/spellchecker to @felixrieseberg/spellchecker for electron-spellchecker, the functionality of checkSpelling seems to have been broken. In main.cc inside @felixrieseberg/spellchecker, I found the following commented out code in Spellchecker::CheckSpelling:

    std::vector<uint16_t> text(string->Length() + 1);

    // Why did we do that?
    // string->Write(reinterpret_cast<uint16_t *>(text.data()));

    Spellchecker* that = Nan::ObjectWrap::Unwrap<Spellchecker>(info.Holder());
    std::vector<MisspelledRange> misspelled_ranges = that->impl->CheckSpelling(text.data(), text.size());

This makes it so that we're not actually passing the input down into the hunspell library. The string->Write(reinterpret_cast<uint16_t *>(text.data())); wasn't commented out in the 4.0.7 version in @nornagon/spellchecker.

@felixrieseberg, why was this code commented out, and where is the source maintained? Thanks!

@felixrieseberg
Copy link
Collaborator

👋 Hey! This module is a bit in a wild state - it was born out of multiple teams collaborating on spellchecking in Electron apps, but we've all taken slightly different paths without a strong interest to combine them again. @nornagon and I are colleages and trade back and forth with fixing this damn thing. My source is here, which to be fair, is virtually impossible to find.

That being said, thanks a ton for taking a look - I'll spend some more time on this today and tomorrow, hopefully hunting down the mistake!

@jeremyspiegel
Copy link
Author

👋Hi! Thanks for taking a look! Sorry I missed that branch in your fork before.

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

No branches or pull requests

2 participants