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

Exception in lsp4j if Eclipse is closing #858

Open
vogella opened this issue Nov 29, 2024 · 1 comment
Open

Exception in lsp4j if Eclipse is closing #858

vogella opened this issue Nov 29, 2024 · 1 comment

Comments

@vogella
Copy link

vogella commented Nov 29, 2024

I'm building an tutorial for users to implement their own LSP server using lsp4J. Works fine and I hope it will help with the adaption of lsp4j. But if the runtime IDE shuts down I get an exception. I think I have seen that also in other LSP implementation and they implemented a fix which AFAICS is not documented.

Is their some information how to prevent this exception?


INFO: The input stream was closed.
java.io.InterruptedIOException
	at java.base/java.io.PipedInputStream.read(PipedInputStream.java:334)
	at java.base/java.io.FilterInputStream.read(FilterInputStream.java:71)
	at java.base/java.io.FilterInputStream.read(FilterInputStream.java:71)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:82)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:114)
	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.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)

@pisv
Copy link
Contributor

pisv commented Nov 29, 2024

Hi Lars,

Thank you very much for your effort with creating the tutorial! It sounds great, and is really appreciated.

Please make sure that cancel(true) is called on the future returned by Launcher.startListening, as has been documented in #777.

The issue looks very similar to #585 and #770.

HTH :-)

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