eclipse-lsp4j / lsp4j

A Java implementation of the language server protocol intended to be consumed by tools and language servers implemented in Java.

Home Page:https://eclipse.org/lsp4j

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

D0zee opened this issue · comments

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.

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

  • Are you able to run the kotlin language server with another client (such as VSCode)
  • Can you manually run the language server by creating a launch configuration and connecting it to LSP4E (via stdin/stdout) using this UI

image

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

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.

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

commented

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

commented

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