vigoux / LanguageTool.nvim

An asynchronous grammar checker for Neovim using LanguageTool
Other
82 stars 3 forks source link

Error: LanguageTool server not started, please run :LanguageToolSetUp #10

Closed mawkler closed 3 years ago

mawkler commented 4 years ago

I'm trying to get LanguageTool working with it installed locally on my system. which languagetool outputs /usr/bin/languagetool and so I put let g:languagetool_server_command='/usr/bin/languagetool' in my init.vim. After running :LanguageToolSetUp (which gave no response after running it btw), running :LanguageToolCheck I get a bunch of errors, including "LanguageTool server not started, please run :LanguageToolSetUp" which I'm guessing is the reason for the rest of the following errors:

Error detected while processing function LanguageTool#check[3]..LanguageTool#config#get[2]..LanguageTool#config#setup[10]..LanguageTool#languages#findLanguage
[5]..<SNR>235_languageIsSupported[2]..LanguageTool#server#get[1]..LanguageTool#server#send_sync:
line    2:
LanguageTool server not started, please run :LanguageToolSetUp
Error detected while processing function LanguageTool#check[3]..LanguageTool#config#get[2]..LanguageTool#config#setup[10]..LanguageTool#languages#findLanguage
[5]..<SNR>235_languageIsSupported:
line    5:
E714: List required
Error detected while processing function LanguageTool#check[3]..LanguageTool#config#get[2]..LanguageTool#config#setup[10]..LanguageTool#languages#findLanguage
[11]..<SNR>235_languageIsSupported:
line    5:
E714: List required
Error detected while processing function LanguageTool#check[3]..LanguageTool#config#get[2]..LanguageTool#config#setup[12]..LanguageTool#languages#findLanguage
[5]..<SNR>235_languageIsSupported:
line    5:
E714: List required
Error detected while processing function LanguageTool#check[3]..LanguageTool#config#get[2]..LanguageTool#config#setup[12]..LanguageTool#languages#findLanguage
[11]..<SNR>235_languageIsSupported:
line    5:
E714: List required
Error detected while processing function LanguageTool#check[3]..LanguageTool#config#get[2]..LanguageTool#config#setup:
line   14:
Failed to guess language from spelllang=[en] or from v:lang=[en_GB.UTF-8]. Defaulting to English (en-US). See ":help LanguageTool" regarding setting language
in g:languagetool.
Error detected while processing function LanguageTool#check[18]..LanguageTool#server#check[9]..LanguageTool#server#send:
line    2:
LanguageTool server not started, please run :LanguageToolSetUp
line   13:
E121: Undefined variable: s:lt_server_started
E15: Invalid expression: s:lt_server_started

What am I doing wrong?

vigoux commented 4 years ago

Starting the LanguageTool server can take a bit of time, and should output a message when the server successfully started, did you tried waiting a bit before actually running the check ?

mawkler commented 4 years ago

Is LanguageToolSetUp non-blocking because I can move the cursor immediately after running it and don't get any indication of it running or finishing. I have tried leaving Neovim for a couple of minutes after running LanguageToolSetUp but LanguageToolCheck still outputs the error above.

Also, running echo LanguageTool#setup() immediately prints 0, which based on based on this comment indicates a success.

vigoux commented 4 years ago

:LanguageToolSetUp is indeed near-non blocking, as it just starts the server. The issue here seems weird, could you set g:languagetool_debug, then run the server, and paste the output of :messages here ?

MaksRawski commented 3 years ago

Had the same problem and appending --http to g:languagetool_server_command seems to have solved the issue.

mawkler commented 3 years ago

could you set g:languagetool_debug, then run the server, and paste the output of :messages here ?

Sorry I realized I never responded to this. I did but still didn't get any message when running LanguageToolSetUp, but fortunately @MaksRawski's solution with appending --http to g:languagetool_server_command. So thanks to you both!