Closed jeanrjc closed 7 years ago
The error might come from the fact that my .tex file is too big (~50k characters) for the languagestool server because it works on smaller files. I'm not sure though. If this is the case, a more verbose error message could be convenient.
Well, it also occurs on smaller files, but at one point, the bug disappears and languagetool works again, but the bug can reappear randomly.
This might be caused by the startup time of the language tool server. Maybe it is not accepting requests immediately and thus the error disappears as soon as startup is completed. I'll have to check the behaviour on larger files as well.
Furthermore, the token "E" might be the start of an error message. I'll see if I can output the full error message instead of throwing the exception.
I just released version 0.5.1. Hopefully, it will show you the answer received from the LanguageTool server for further debugging.
I have indeed a warning (which disappear a bit too rapidly) with the appropriate error message:
The stack Trace of the new error is:
TypeError: Cannot read property 'matches' of undefined
at IncomingMessage.<anonymous> (/Users/xxxx/.atom/packages/linter-languagetool/lib/linter-provider.coffee:108:32)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
I did not have any errors with smaller files (yet?).
Maybe it could be nice to send the 20k char to the server that are around the cursor, if the file contains more than 20k chars or something similar to this.
Thanks
Are you using the public LanguageTool Server or did you set up a server on your machine (just need too download a jar file). I believe the limit only applies for the public server. That is, the proper solution of your problem would be to run language tool on your own device.
Of course we should fix the error message.
You're right. I used the public server. I tried the local server the last time but it did not work, but now it works, so it's good. I updated to version 0.5.2 and the error message disappeared so it's good.
Just the warning message disappears a bit too quickly, so you barely have time to realize what it is, especially if you don't expect it. If you can, adding a message advising to switch to a local server as a solution might be better than recommending shortening the text.
Thank you very much for the rapid fix and solution!
I'll try to keep the warning message open a little bit longer. However, I currently think that it is controlled by Atom itself and we can not really influence it.
An improved error message however is a nice suggestion!
Hi, I got the following error when installing your package:
Step to reproduce:
Atom: 1.19.7 x64 Electron: 1.6.9 OS: Mac OS X 10.11.5 Thrown From: linter-languagetool package 0.5.0
Stack Trace
Uncaught SyntaxError: Unexpected token E in JSON at position 0
Commands
Non-Core Packages