ltex-plus / ltex-ls-plus

LTeX Language Server: LSP language server for LanguageTool :mag::heavy_check_mark: with support for LaTeX :mortar_board:, Markdown :pencil:, and others
https://ltex-plus.github.io/ltex-plus/
Mozilla Public License 2.0
13 stars 3 forks source link

`ltex-ls-plus` not working over `Tcp` #33

Closed JonasWischeropp closed 1 month ago

JonasWischeropp commented 1 month ago

Describe the bug Using ltex-ls-plus over Tcp throws an exception. In VS Code just the loading symbol is shown.

(When I use the VS Code extension normally without setting ltex.languageToolHttpServerUri everything works.)

Steps to reproduce Steps to reproduce the behavior:

  1. start ls: $HOME/.vscode/extensions/ltex-plus.vscode-ltex-plus-15.1.0/lib/ltex-ls-plus-18.1.0/bin/ltex-ls-plus --server-type=TcpSocket --port=9095
  2. perform the VS Code LTeX: Check Current Document action

Expected behavior The document should be checked.

LTeX configuration "ltex.languageToolHttpServerUri": "http://localhost:9095/"

LTeX LS log

``` Oct 10, 2024 3:52:31 PM org.bsplines.ltexls.LtexLanguageServerLauncher launchServer INFO: Waiting for client to connect on port 9095... Oct 10, 2024 3:52:35 PM org.bsplines.ltexls.LtexLanguageServerLauncher launchServer INFO: Connected to client on port 9095 Oct 10, 2024 3:52:45 PM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint lambda$recursiveFindRpcMethods$2 SEVERE: A delegate object is null, jsonrpc methods of 'public default org.eclipse.lsp4j.services.NotebookDocumentService org.eclipse.lsp4j.services.LanguageServer.getNotebookDocumentService()' are ignored Oct 10, 2024 3:52:45 PM org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer fireError SEVERE: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ at com.google.gson.Gson.fromJson(Gson.java:975) at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.parseMessage(MessageJsonHandler.java:119) at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.parseMessage(MessageJsonHandler.java:114) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:193) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:384) at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:92) at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:55) at com.google.gson.Gson.fromJson(Gson.java:963) ... 11 more ```

Version information

(Uses the versions distributed with vscode-ltex-plus)

spitzerd commented 1 month ago

Confirmed. I have tried Windows and Ubuntu and I get the same error. It's also not working with the original LTeX from Julian Valentin

spitzerd commented 1 month ago

I have to correct my previous statement. The usage you described in your issue is wrong. It's not meaningful to point "ltex.languageToolHttpServerUri" to ltex-ls-plus. Let me explain:

The option--server-type=TcpSocket was designed for other purposes and I also don't know how to use it exactly.

I guess your use case is to run the spell check on another server and not on your computer.

JonasWischeropp commented 1 month ago

Thank you. I should have read the documentation more carefully. Turns out it's actually ltex.ltex-ls.path I was looking for to test my changes to ltex-ls-plus with the vscode client.