Skip to content
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

Setting ltex.languageToolHttpServerUri for ltex-ls does not seem to be working #2621

Open
cristobaltapia opened this issue May 17, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@cristobaltapia
Copy link

Description

I have started a languagetool server in my homeserver. The server works correctly, as I could corroborate by running curl --data "language=en-US&text=a simple test" http://192.168.1.103:8010/v2/check. However, when adding the option ltex.languageToolHttpServerUri=http://192.168.1.103:8010/ ltex-ls does not perform the check.

Neovim version

NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3

Nvim-lspconfig version

30a2320

Operating system and version

Archlinux

Affected language servers

ltex-ls

Steps to reproduce

  1. Open a file with text to check
  2. Wait for ltex-ls to check the text

Actual behavior

No grammar correction is made.

Expected behavior

The grammar corrections should be performed in the homeserver.

Minimal config

nvim_lsp.ltex.setup {
    cmd = { "/usr/bin/ltex-ls" },
    settings = {
        ltex = {
            language = "en-US",
            languageToolHttpServerUri = "http://192.168.1.103:8081/",
        },
    },
}

LSP log

https://gist.github.com/cristobaltapia/f3d5db6b86da191432db74862ac8313f

@cristobaltapia cristobaltapia added the bug Something isn't working label May 17, 2023
@glepnir
Copy link
Member

glepnir commented May 17, 2023

find this in log

	"rpc"	"/usr/bin/ltex-ls"	"stderr"	"May 17, 2023 2:25:39 PM org.bsplines.ltexls.languagetool.LanguageToolHttpInterface checkInternal\nSEVERE: Could not send the HTTP request to the LanguageTool server. The following exception occurred:\njava.net.ConnectException: Connection refused\n\tat java.net.http/jdk.internal.net.http.HttpClientImpl.send(Unknown Source)\n\tat java.net.http/jdk.internal.net.http.HttpClientFacade.send(Unknown Source)\n\tat org.bsplines.ltexls.languagetool.LanguageToolHttpInterface.checkInternal(LanguageToolHttpInterface.kt:73)\n\tat org.bsplines.ltexls.languagetool.LanguageToolInterface.check(LanguageToolInterface.kt:22)\n\tat org.bsplines.ltexls.server.DocumentChecker.checkAnnotatedTextFragment(DocumentChecker.kt:138)\n\tat org.bsplines.ltexls.server.DocumentChecker.checkAnnotatedTextFragments(DocumentChecker.kt:91)\n\tat org.bsplines.ltexls.server.DocumentChecker.check(DocumentChecker.kt:279)\n\tat org.bsplines.ltexls.server.LtexTextDocumentItem.check(LtexTextDocumentItem.kt:413)\n\tat org.bsplines.ltexls.server.LtexTextDocumentItem.checkAndGetDiagnostics(LtexTextDocumentItem.kt:295)\n\tat org.bsplines.ltexls.server.LtexTextDocumentItem.checkAndPublishDiagnostics(LtexTextDocumentItem.kt:272)\n\tat org.bsplines.ltexls.server.LtexTextDocumentItem.checkAndPublishDiagnosticsWithoutCache(LtexTextDocumentItem.kt:267)\n\tat org.bsplines.ltexls.server.LtexTextDocumentItem.checkAndPublishDiagnosticsWithoutCache$default(LtexTextDocumentItem.kt:266)\n\tat org.bsplines.ltexls.server.LtexTextDocumentService.didOpen$lambda-1(LtexTextDocumentService.kt:155)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)\n\tat java.base/java.util.concurrent.FutureTask.run(Unknown Source)\n\tat java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n\tat java.base/java.lang.Thread.run(Unknown Source)\nCaused by: java.net.ConnectException: Connection refused\n\tat java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)\n\tat java.base/sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)\n\tat java.net.http/jdk.internal.net.http.PlainHttpConnection$ConnectEvent.handle(Unknown Source)\n\tat java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(Unknown Source)\n\tat java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(Unknown Source)\n\tat java.base/java.util.ArrayList.forEach(Unknown Source)\n\tat java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(Unknown Source)\n\n"

@cristobaltapia
Copy link
Author

So is this an ltex-ls problem then? I cannot make much sense of these java errors :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants