eclipse-lsp4j / lsp4j

A Java implementation of the language server protocol intended to be consumed by tools and language servers implemented in Java.
https://eclipse.org/lsp4j
Other
582 stars 141 forks source link

Stream is closed when I'm trying to connect client and language server via lsp4j #747

Closed D0zee closed 1 year ago

D0zee commented 1 year ago

Hello everyone! I'm contributing in eclipse buildship as Google Summer of Code contributor. Now I must connect kotlin-language-server to the eclipse client. This language server has support from Eclipse and it uses lsp4j. But when I pack this server as jar file and try to launch it via provider. This is code of provider class and it just launch kotlin-language-server.

The issue is concluded in that I get IOException about stream is closed. I tried to upgrade locally the version of lsp4j to last in kotlin-language-server but it doesn't give success. I also tried to pack the language server by Jar command and by ShadowJar tasks in gradle. And it also wasn't successful. Maybe there is default solutions to my problems. I will be very glad to get any answers and advices how to avoid this exception.

jonahgraham commented 1 year ago

This question seems a little like an LSP4E question (because it seems your issue is on the client side). Some things to try:

image

D0zee commented 1 year ago

yes, I am able to run this server with another client (I used VSCode) and it's working with one. But when I pack server as jar and try to launch it via provider I have exception about stream closed

jonahgraham commented 1 year ago

And does it work when you configure/launch it from the UI I screenshoted? Using that UI means you don't have any of your code, nor do you have to package it yet. I am asking to find out if the issue is packaging or compatiblily with LSP4E.

cdietrich commented 1 year ago

the server seems to use lsp4j 0.15.0 so i assume you also need to use an old lsp4e that uses that old lsp4j

angelozerr commented 1 year ago

As you generate a command, have you try to start the command in a terminal to ckeck that server starts correctly?

angelozerr commented 1 year ago

I suggest you too that you enable log for your server to see the LSP traces with LSP4E