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

ltex-ls-plus not working over Tcp #33

Closed
JonasWischeropp opened this issue Oct 10, 2024 · 3 comments
Closed

ltex-ls-plus not working over Tcp #33

JonasWischeropp opened this issue Oct 10, 2024 · 3 comments
Assignees

Comments

@JonasWischeropp
Copy link
Contributor

JonasWischeropp commented Oct 10, 2024

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

  • Operating system: Ubuntu 22.04.5 LTS
  • vscode-ltex-plus: 15.1.0
  • ltex-ls-plus: 18.1.0
  • Java: 21.0.4+7

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

@spitzerd
Copy link
Contributor

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
Copy link
Contributor

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 VS Code extension communicated always via the Language Server Protocol (LSP) with the language server ltex-ls-plus
  • ltex-ls-plus can spell check either with the integrated LanguageTool or can communicate with an HTTP LanguageTool server

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.

  • Start LanguageTool on your server or your computer. You can find a manual here: https://dev.languagetool.org/http-server
  • Set "ltex.languageToolHttpServerUri" to the address of your LanguageTool Server, e.g. http://localhost:8081

@JonasWischeropp
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants