AtomLinter / linter-spell

Multilingual grammar-specific spell checking for Atom and linter using Ispell compatible interface such as GNU Aspell or Hunspell.
https://atom.io/packages/linter-spell
MIT License
14 stars 1 forks source link

"Call to hunspell failed with a code of 1." #38

Closed caesar closed 7 years ago

caesar commented 7 years ago

When I enable the plugin, it shows the error: Call to hunspell failed with a code of 1.

I have installed hunspell using brew and I have tried setting the path manually in linter-spell's preferences (/usr/local/bin/hunspell). The message remains the same.

There are no errors logged in the Javascript console, though linter-spell is logging the message: All dependencies installed, good to go.

yitzchak commented 7 years ago

Do you get the error message immediately after enabling?

caesar commented 7 years ago

Yes, immediately after enabling. Also when opening Atom, if the plugin is enabled.

caesar commented 7 years ago

FWIW, calling hunspell from the command line works, so there is no problem with my hunspell install.

yitzchak commented 7 years ago

Can you try hunspell -D on the command line?

caesar commented 7 years ago
$ hunspell -D
SEARCH PATH:
.::/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/Users/caesar/.openoffice.org/3/user/wordbook:.openoffice.org2/user/wordbook:.openoffice.org2.0/user/wordbook:Library/Spelling:/opt/openoffice.org/basis3.0/share/dict/ooo:/usr/lib/openoffice.org/basis3.0/share/dict/ooo:/opt/openoffice.org2.4/share/dict/ooo:/usr/lib/openoffice.org2.4/share/dict/ooo:/opt/openoffice.org2.3/share/dict/ooo:/usr/lib/openoffice.org2.3/share/dict/ooo:/opt/openoffice.org2.2/share/dict/ooo:/usr/lib/openoffice.org2.2/share/dict/ooo:/opt/openoffice.org2.1/share/dict/ooo:/usr/lib/openoffice.org2.1/share/dict/ooo:/opt/openoffice.org2.0/share/dict/ooo:/usr/lib/openoffice.org2.0/share/dict/ooo
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
Library/Spelling/en_GB
LOADED DICTIONARY:
Library/Spelling/en_GB.aff
Library/Spelling/en_GB.dic
Hunspell 1.5.4

Does not exit unless I press Ctrl+C. (I don't know if that's intended behaviour?)

Note that the en_GB dictionary files are in ~/Library/Spelling, although hunspell omits the ~/.

Also, They were previously called en-GB (with a hyphen instead of an underscore), which works fine for the OS X spell checker, but hunspell complained: Can't open affix or dictionary files for dictionary named "en_GB". so I had to rename them…

yitzchak commented 7 years ago

hunspell won't exit until it sees an end of file marker. Try using ctrl-d then do a echo $?. Assuming you are using a bash-like shell.

caesar commented 7 years ago

I'm using fish, so it's $status instead of $? – but anyway: the exit status is 0.

yitzchak commented 7 years ago

I have reproduced it. No idea why but it looks like hunspell isn't finding any dictionaries when called from inside Atom.

caesar commented 7 years ago

Interesting… how did you reproduce this? Presumably it does not apply for everybody, so what did you do to make it happen? How might my config (which seems fairly vanilla) differ from setups where it works?

yitzchak commented 7 years ago

Nothing in particular. The last time the CI build ran on MacOS it used hunspell v1.4.1. Since then hunspell has upgraded to v1.5.4 and CI is failing so it is probably something there.

I'll look around and see if I can find the problem.

yitzchak commented 7 years ago

@caesar Just pushed out a patch (v0.12.6). Give it a try.

caesar commented 7 years ago

It works! 🎉

Thanks for sorting this out so fast @yitzchak!

yitzchak commented 7 years ago

Awesome. Thanks for taking the time to report the issue.

INemesisI commented 7 years ago

Hello, This week, exactly the same error message described in this issue appeared on my machine I'm using version 0.12.6 and hunspell v 1.6.0 on macOS. For me it looks like a hunspell update broke the plugin for me.

intercaetera commented 7 years ago

Happens to me as well, using elementary OS Loki.

yitzchak commented 7 years ago

Thanks for the issue notification! I'll try to reproduce it.

kitchenknif commented 7 years ago

Also have the issue on macOS Hunspell 1.6.1 linter-spell 0.13

Hunspell from cli works.

juliaanvaneijndt commented 7 years ago

Same here :-/

macOS Hunspell 1.6.1 linter-spell 0.13.2

chapmanc commented 7 years ago

Have this issue as well, but my error says failed with a status code of null macOS Hunspell 1.6.1 linter-spell 0.13.2

chapmanc commented 7 years ago

Specifying full path worked.

QuentinRoy commented 6 years ago

Same issue with hunspell 1.6.2, atom 1.23 and linter-spell 0.15 (exit code 1).

stevenlis commented 6 years ago

@chapmanc I also got the same error that "call to hunspell failed with a code of null". Is hunspell automatically installed with the package? By the way, could you pls share the path since I am not sure how to find it. Btw, I'm using wins 10.

Aerijo commented 6 years ago

Is hunspell automatically installed with the package

No. Most, if not all, external programs are not installed by any packages.

stevenlis commented 6 years ago

@Aerijo Is there any way to install it? I did some research but all institutions are about mac. I actually did a search and somehow find some hunspell files under Anaconda3 folder. Should I copy one of those files path into linter-spell settings in Atom?

snap1

Aerijo commented 6 years ago

@stevencollinscn Hunspell is a program in and of itself. Short of a prebuilt version, the github repo seems to have instructions on how to build it for Windows.

https://github.com/hunspell/hunspell

stevenlis commented 6 years ago

@Aerijo I tried to follow the instruction for windows but got the following errors while trying to run those commends on their github page. I also saw other users have this issue as well. snap2

ptytb commented 5 years ago

I got it working with Hunspell from Cygwin distribution.

Install Hunspell and dictionaries from Cygwin, then create a file hunspell.bat:

@echo off
C:\cygwin64\bin\bash -c "/bin/hunspell %*"

Go to Atom, open linter-spell plugin settings, put hunspell.bat into Spell Path field. Now Ctrl-Shift-Y works, spell checking works.