Issue while extending org.eclipse.xtext.ide.server.LanguageServerImpl into GLSPServer #457
-
I am using GLSP server and glsp vscode client(https://github.com/eclipse-glsp/glsp-vscode-integration). I want to add language functionality into GLSP server. Typefox's example (https://github.com/eclipse/sprotty-vscode) which supports both diagram and language uses below approach which is based on sportty. Language server will be extended into diagram server: https://github.com/eclipse/sprotty-server/blob/5d6c6c25e7d5d7ded5c19fc6282a1a45137154ac/org.eclipse.sprotty.xtext/src/main/java/org/eclipse/sprotty/xtext/ls/DiagramLanguageServer.xtend vscode extension: https://marketplace.visualstudio.com/items?itemName=typefox.states-extension So, I tried to extend XTEXT's org.eclipse.xtext.ide.server.LanguageServerImpl into glsp server (creating a new server class by extending org.eclipse.xtext.ide.server.LanguageServerImpl and implementing org.eclipse.glsp.server.protocol.GLSPServer). But we have issues related to initialize() and shutdown() methods as parameter type and return types are different. org.eclipse.xtext.ide.server.LanguageServerImpl extends interface org.eclipse.lsp4j.services.LanguageServer which as below methods which are conflicting with org.eclipse.glsp.server.protocol.GLSPServer methods. So we are not able to extend org.eclipse.xtext.ide.server.LanguageServerImpl into org.eclipse.glsp.server.protocol.GLSPServer. org.eclipse.glsp.server.protocol.GLSPServe:
} org.eclipse.lsp4j.services.LanguageServer:{
} initialize: Has different input parameter type. To solve this issue, GLSP server's initialize() and shutdown() methods need to be updated(we have to change method names or we have to update parameter type and return type). Any other way to resolve this issue? Any other way to include language functionality(LSP support for textual languages) into GLSP server? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We can extend LanguageServerImpl into GLSPServe with above 2 changes but client side as we have change many things. Instead of this we can run 2 servers at server side(GLSP as diagram server and a language server) in 2 different ports. At client side we have to create and start language client which will interact with language server along with GLSP's client. In my case, I am using same injector for GLSP and language functionality(Mixed GLSP's DiagramModule and language's module). #356 here few details related to language functionality are discussed. |
Beta Was this translation helpful? Give feedback.
We can extend LanguageServerImpl into GLSPServe with above 2 changes but client side as we have change many things.
We have to replace BaseJsonrpcGLSPClient with language client which is a vscode API.
Instead of this we can run 2 servers at server side(GLSP as diagram server and a language server) in 2 different ports. At client side we have to create and start language client which will interact with language server along with GLSP's client. In my case, I am using same injector for GLSP and language functionality(Mixed GLSP's DiagramModule and language's module).
#356 here few details related to language functionality are discussed.