vscode-languagetool-linter
vscode-languagetool-linter copied to clipboard
Slow in finding quick fixes
Describe the bug The quick fix on hover, takes more than 5 seconds to load in most of the time.
To Reproduce Steps to reproduce the behavior:
- Save a MD file with grammar & spelling mistakes
- Hover over a mistake to see the quick fix
- Wait...
Expected behavior I believe it should not take this long to fetch corrections for a file with less than 120 lines. Am I missing a setting or something in my setup?
Screenshots
´´´terminal output GMT+02:00 INFO org.languagetool.server.TextChecker Check done: 3794 chars, en-GB (mother tongue: nl), requestId: null, #1, null, 0/5 matches, 16029ms, agent:-, sent, q:0, h:2, dH:1, r:2, m:all, premium: false 2023-03-30 15:39:37.226 GMT+02:00 INFO org.languagetool.server.TextChecker Check done: 3794 chars, en-GB (mother tongue: nl), requestId: null, #1, null, 0/5 matches, 14246ms, agent:-, sent, q:0, h:2, dH:1, r:2, m:all, premium: false 2023-03-30 15:39:37.227 GMT+02:00 INFO org.languagetool.server.LanguageToolHttpHandler Handled request in 14298ms; sending code 200 2023-03-30 15:39:37.227 GMT+02: ´´´
Environment & Configuration (please complete the following information):
- OS + Version: Windows 10 Home
- VS Code Version: 1.76.2
- LanguageTool Linter Version: 0.19.0
- LanguageTool Version: 3.8.0
- Service Configuration: managed
- Service Classpath (if 'managed'): C:\Users\Me\AppData\Local\LanguageTool-6.1\languagetool-server.jar
@ScriptJayT - Thanks for opening this issue. It's concerning, to say the least. I'll do my best to recreate the problem. Can you tell me how you went about installing LanguageTool? Was it their Editor App, scoop, or something else?
Hey @davidlday I downloaded the tool manually from your wiki and then extracted the zip to the C:\Users\Me\AppData\Local\ directory.
These are the extensions I used in VS Code and their settings to get it working:
-
- Language: en-GB
- Enabled: true
-
- Language: en-GB
- Mother Tongue: nl
- Preferred Variants: <empty>
- PLain Text Enabled: true
- Language Ids: plaintext
- Diagnostic Severity: Information
- Enabled: true
- External Api Key: <empty>
- External Url: <empty>
- External Username: <empty>
- Hide diagnostics on change: false
- Hide Rule Ids: true
- Disabled Categories: <empty>
- Disabled Rules: <empty>
- Ignored Word Hint: true
- Ignored Words Global: <empty>
- Ignored Words in Workspace: <empty>
- Lint On Change: false
- Lint On Open: false
- Lint On Save: true
- Class Path: C:\Users\Me\AppData\Local\LanguageTool-6.1\languagetool-server.jar
- Jar File: <empty>
- Port Max: 65535
- Port Min: 9500
- Service Type: managed
- Smart Format On Save: false
- Smart Format On Tpe: false
Hope this helps.
Definitely helps. Unfortunately, it's going to be about a week before I can get back to this, but I will get back to it.
@ScriptJayT - I sat down to try and recreate the issue this morning. Do you have all three of those extensions installed? If so, they're likely competing with each other.
LanguageTool for VS Code and English Support for LanguageTool were the original LanguageTool extension created by Adam Voss, who passed away in 2018. They're no longer maintained. Can you uninstall both of those extensions and try again, please?
Side note - I've tried working with Microsoft to have those extensions removed or archived, but I haven't had any luck, so I just gave up.
That would explain a lot.
I did disable the other two extensions and it seems to have improved a bit. Now the quick fix, once loaded, does not take nearly as long to appear. Great! This is a lot more useable. I did notice that the first pass did still take 15163ms for a file of 341 characters, I assume a cold run could take this long? Following runs took 450ms or less, that seems as expected.
The settings are the same, except I used the Managed: Jar File field over the Managed: Class Path field; for some reason the class path could not be found properly now.
Thank you for the follow up! @davidlday
I did disable the other two extensions and it seems to have improved a bit. Now the quick fix, once loaded, does not take nearly as long to appear. Great! This is a lot more useable. I did notice that the first pass did still take 15163ms for a file of 341 characters, I assume a cold run could take this long? Following runs took 450ms or less, that seems as expected.
That still seems like an unreasonably long time even for the initial run. Maybe the service was still starting at the time. Are you still experiencing this behavior?
It seems so, I'll include the output messages from this instance I run. It's similar to last time. There seem to be some warnings with connection issues that seem to resolve themselves, perhaps they might have something to do with the slow startup?
language: en-GB
motherTongue: nl
LanguageTool Linter Activated!
Starting managed service.
Error connecting to http://localhost:9500/v2/check
FetchError: request to http://localhost:9500/v2/check failed, reason: connect ECONNREFUSED 127.0.0.1:9500
2023-04-22 16:14:18.630 GMT+02:00 INFO org.languagetool.server.DatabaseAccessOpenSource Not setting up database access, dbDriver is not configured
2023-04-22 14:14:18 +0000 Setting up thread pool with 10 threads
WARN: no common words file defined for Japanese - this language might not be correctly auto-detected
WARN: no common words file defined for Khmer - this language might not be correctly auto-detected
2023-04-22 14:14:27 +0000 Starting LanguageTool 6.1 (build date: 2023-03-28 15:15:21 +0000, a6449c3) server on http://localhost:9500...
2023-04-22 14:14:27 +0000 Server started
2023-04-22 16:15:34.528 GMT+02:00 INFO org.languagetool.server.LanguageToolHttpHandler Handling POST /v2/check
2023-04-22 16:15:48.661 GMT+02:00 INFO org.languagetool.server.TextChecker Check done: 428 chars, en-GB (mother tongue: nl), requestId: null, #1, null, 0/1 matches, 13107ms, agent:-, sent, q:0, h:1, dH:1, r:1, m:all, premium: false
2023-04-22 16:15:48.664 GMT+02:00 INFO org.languagetool.server.LanguageToolHttpHandler Handled request in 14183ms; sending code 200
2023-04-22 16:15:54.142 GMT+02:00 INFO org.languagetool.server.LanguageToolHttpHandler Handling POST /v2/check
2023-04-22 16:15:54.452 GMT+02:00 INFO org.languagetool.server.TextChecker Check done: 428 chars, en-GB (mother tongue: nl), requestId: null, #2, null, 0/1 matches, 300ms, agent:-, sent, q:0, h:1, dH:1, r:2, m:all, premium: false
2023-04-22 16:15:54.453 GMT+02:00 INFO org.languagetool.server.LanguageToolHttpHandler Handled request in 311ms; sending code 200