Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Language server not responding to client request(Language server not responding to client request)
Language server not responding to client request [message #1850625] Thu, 10 March 2022 18:08 Go to next message
Nagaraj Kandoor is currently offline Nagaraj KandoorFriend
Messages: 38
Registered: May 2020
Member
Hi there,

When I tried to run language server manually, my newly build vscode extension works fine will get language features(code completions etc.) Pleas find image of server client interaction.

When I have bundled language server and client into a vs code extension. No language feature are show in editor.(Please find image of language server activation)

Not able to get what's going wrong with language server with embedded mode.(no error) through the client calling batch script to active ls server.

Any suggestion and inputs to analyze this further.

VS code version: 1.65.0.

Thanks
Nagaraj





Re: Language server not responding to client request [message #1850626 is a reply to message #1850625] Thu, 10 March 2022 18:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14353
Registered: July 2009
Senior Member
Can you check all non class files e.g. meta inf services, xtextbin etc are properly packaged.
Besides that: remote debug the server


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Language server not responding to client request [message #1850640 is a reply to message #1850626] Fri, 11 March 2022 14:19 Go to previous messageGo to next message
Nagaraj Kandoor is currently offline Nagaraj KandoorFriend
Messages: 38
Registered: May 2020
Member
@Christian Dietrich
Thank you will try suggestion.
Re: Language server not responding to client request [message #1850642 is a reply to message #1850640] Fri, 11 March 2022 15:35 Go to previous messageGo to next message
Nagaraj Kandoor is currently offline Nagaraj KandoorFriend
Messages: 38
Registered: May 2020
Member
@ Christian Dietrich
After debugging I found Socket is closed in embedded mode after launch of language server.

VS Debug console:

ApplicationInsights:CorrelationIdManager (1) [Error [ERR_SOCKET_CLOSED]: Socket is closed
at Socket._writeGeneric (net.js:775:8)
at Socket._wri...]
ApplicationInsights:CorrelationIdManager (1) [Error [ERR_SOCKET_CLOSED]: Socket is closed
at Socket._writeGeneric (net.js:775:8)
at Socket._wri...]
ApplicationInsights:Failed to read persisted file (1) [SyntaxError: Unexpected token { in JSON at position 794
at JSON.parse (<anonymous>)
at c:\Users\q...]
rejected promise not handled within 1 second: TypeError: t.forEach is not a function
stack trace: TypeError: t.forEach is not a function
at e.<anonymous> (c:\Users\qxz2n8n\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode-remote.remote-wsl-recommender\dist\extension.js:1:293734)
at c:\Users\qxz2n8n\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode-remote.remote-wsl-recommender\dist\extension.js:1:291888
at Object.next (c:\Users\qxz2n8n\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode-remote.remote-wsl-recommender\dist\extension.js:1:291993)
at c:\Users\qxz2n8n\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode-remote.remote-wsl-recommender\dist\extension.js:1:290911
at new Promise (<anonymous>)
at c:\Users\qxz2n8n\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode-remote.remote-wsl-recommender\dist\extension.js:1:290645
at e.send (c:\Users\qxz2n8n\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode-remote.remote-wsl-recommender\dist\extension.js:1:293498)
at c:\Users\qxz2n8n\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode-remote.remote-wsl-recommender\dist\extension.js:1:301264
at FSReqCallback.oncomplete (fs.js:171:23)
at FSReqCallback.callbackTrampoline (internal/async_hooks.js:131:14)
Re: Language server not responding to client request [message #1850644 is a reply to message #1850642] Fri, 11 March 2022 16:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14353
Registered: July 2009
Senior Member
then you need to find out why (debug the server)

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Fri, 11 March 2022 16:35]

Report message to a moderator

Re: Language server not responding to client request [message #1850653 is a reply to message #1850644] Sat, 12 March 2022 11:17 Go to previous messageGo to next message
Nagaraj Kandoor is currently offline Nagaraj KandoorFriend
Messages: 38
Registered: May 2020
Member
Sure thanks.
Re: Language server not responding to client request [message #1850655 is a reply to message #1850653] Sat, 12 March 2022 12:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14353
Registered: July 2009
Senior Member
Naive question: how do you create the server jar

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Language server not responding to client request [message #1850662 is a reply to message #1850655] Sun, 13 March 2022 09:33 Go to previous messageGo to next message
Nagaraj Kandoor is currently offline Nagaraj KandoorFriend
Messages: 38
Registered: May 2020
Member
@ Christian Dietrich
To answer your question we create server jar using maven-shade-plugin.

I have made one interesting observation i was going through xtext ls git example.

We create LanguageClient object by passing serverOptions and clientoptions. https://github.com/itemis/xtext-languageserver-example/blob/9bbefcaf566cb88365736653bc036944bdc62504/vscode-extension-self-contained/src/extension.ts#L28(I am able to start server in embedded mode)

What i observed is how client will communicate with server, client doesn't know server is listening to which port?

In detach mode we do same thing https://github.com/itemis/xtext-languageserver-example/blob/9bbefcaf566cb88365736653bc036944bdc62504/vscode-extension/src/extension.ts#L14 (here we are explicitly connecting to server port)


If my observation is correct I have gone through LanguageClient and ServerOption class of vscode library, but i couldn't figure out how do i let know client that server is running in specific port, no such method.

Looking forward to your suggestions?

Thanks
Nagaraj

[Updated on: Sun, 13 March 2022 09:43]

Report message to a moderator

Re: Language server not responding to client request [message #1850664 is a reply to message #1850662] Sun, 13 March 2022 15:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14353
Registered: July 2009
Senior Member
the client is hardcoding port, the server is hartcoding hartcoding port
the client decides if server or io mode.
the sevrer decides if server or io mode (choosing main class)
which mainclass and which extension do you use.
how do you test "without" packaging


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Language server not responding to client request [message #1850688 is a reply to message #1850664] Mon, 14 March 2022 13:44 Go to previous messageGo to next message
Nagaraj Kandoor is currently offline Nagaraj KandoorFriend
Messages: 38
Registered: May 2020
Member
@Christian Dietrich

To answer your question
We create vsix vs code extension which include runnable jar. To run this in embedded mode we have a batch script which is invoked by client similar(https://github.com/itemis/xtext-languageserver-example/blob/9bbefcaf566cb88365736653bc036944bdc62504/vscode-extension-self-contained/src/extension.ts#L12 ).

Our server implementation is similar to https://github.com/itemis/xtext-languageserver-example/blob/9bbefcaf566cb88365736653bc036944bdc62504/org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/RunServer.java#L35

If i understood your answer correctly server socket approach only works in detach mode?



Re: Language server not responding to client request [message #1850689 is a reply to message #1850688] Mon, 14 March 2022 13:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14353
Registered: July 2009
Senior Member
runserver is socket. vscode-extension-self-contained is process io.
vscode-extension-self-contained uses ServerLauncher as main class
https://github.com/itemis/xtext-languageserver-example/blob/9bbefcaf566cb88365736653bc036944bdc62504/org.xtext.example.mydsl.ide/build.gradle#L17
which is for process io

- client socket + server socket if port is free
- client process io + server process io

will both work.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Mon, 14 March 2022 13:58]

Report message to a moderator

Re: Language server not responding to client request [message #1850694 is a reply to message #1850689] Mon, 14 March 2022 16:08 Go to previous message
Nagaraj Kandoor is currently offline Nagaraj KandoorFriend
Messages: 38
Registered: May 2020
Member
@Christian Dietrich
Thank you!!! Resolved issue.
Previous Topic:Trigger validator(builder) for multiple files
Next Topic:How to avoid ambiguity
Goto Forum:
  


Current Time: Mon Oct 03 02:09:40 GMT 2022

Powered by FUDForum. Page generated in 0.03347 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top