-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Checking of long documents fails with LanguageTool Premium API #215
Comments
I see the same issue on emacs / lsp-ltex-ls (though I can't find a log that confirms the 413 error code) For me, the limit seems to be around ~20000 chars, and according to https://languagetoolplus.com/http-api/#/default this would mean that my credentials don't really work... Do you have any hints on how to debug this? |
Okay, I did some more checking by enabling logging.
Are the texts actually sent like this in JSON, i.e., everything is split into single elements for every character? Maybe the request body will be too large then. Edit: It seems the answer is yes: ltex-ls/src/main/kotlin/org/bsplines/ltexls/languagetool/LanguageToolHttpInterface.kt Lines 175 to 203 in 1a58976
I'm unsure if this is the root cause, but the loop can certainly be optimized to produce shorter JSON. |
Okay, this is the root cause... I have some local changes that optimize the JSON output. I can open a PR soon. |
That would be very nice 👍 |
See #228, which works well for me locally. Still, more should be done. We should at least truncate the JSON output at the API limit. We could also split it into multiple requests, but I'm convinced that this is much better because then you easily hit the minutely limits. By the way, it's still a good idea to set |
I still see this problem in VS Code. Was the extension updated on the VS Code marketplace? Should I install something manually? |
I tried a night build from the release section of GitHub repository. VS Code shows "Starting LTeX..." at the bottom forever. The LTeX Language Server output shows
I tried changing the Java runtime, no help. How can I use the fix for this problem? |
I get the same problem while using nvim v0.9.1 and ltex-ls v16.0.0 implemented with null-ls. However, the same file gets checked correctly in vscode with vscode-ltex v13.1.0 |
@danielnaber I reached out to LanguageTooler GmbH. I explained to the support that the limit of 150,000 characters is a fake because this limit includes the characters in the augmented text, not the actual text being checked. Users cannot control the former. Since it is entirely unexpected for any user, it elevates to being lied to about the product when users buy it. I suggested setting the limit on the characters of the actual text. The support replied, “This is not intended to be changed,” and ghosted. They didn’t comment about lying about the product. I tried talking to a lawyer in the US, but he said that the fact that the company is in Germany makes it difficult. So, guys, if you are in Germany, you may be able to file a customer fraud case. Meanwhile, I've done the minimum I could: I have canceled my Premium subscription. The funny part is that they've sent me an email (automated) asking me to cancel my cancellation. Within the sales pitch, among other things, they mentioned that “It can also check longer texts with up to 100,000 characters.” I replied that 100,000 characters is a lie because it limits an arbitrary amount of augmentation, not the actual text. They didn't answer. Oh, well. I switched to Grammarly. |
Describe the bug
Long documents are not checked when the LanguageTool HTTP API is used. Requests seem to fail with error 413. When checking a (short) selection of the document, it works as expected. The full document is also correctly checked when the local LanguageTool instance is used (i.e., when no
languageToolHttpServerUri
is configured). A long document is any document with, e.g., 8000 words and 50000 characters.Steps to reproduce
Open long document in VSCode, wait forever for language check results (or watch failure in LTeX Language Server logs).
Expected behavior
The document is fully checked. If the text is too long, I would expect it to be split into multiple separate requests that get successfully processed. In the worst case though, it should at least show a visible warning to the user instead of silently failing.
Sample document
Reproduction sample can be generated on https://www.lipsum.com/ by choosing 8000 words.
LTeX configuration
LTeX LS log
Version information
The text was updated successfully, but these errors were encountered: