-
-
Notifications
You must be signed in to change notification settings - Fork 59
ELS: Why workspace/configuration is called every time even if we do nothing? #523
-
When I start ELS in IJ with LSP4IJ and I do nothing, I see that there are a lot of request 'workspace/configuration' which takes few CPU:
[Trace - 10:21:33] Received request 'workspace/configuration - (10000)'
Params: {
"items": []
}
[Trace - 10:21:33] Sending response 'workspace/configuration - (10000)'. Processing request took 0ms
Result: []
[Trace - 10:21:38] Received request 'workspace/configuration - (10000)'
Params: {
"items": []
}
[Trace - 10:21:38] Sending response 'workspace/configuration - (10000)'. Processing request took 0ms
Result: []
[Trace - 10:21:43] Received request 'workspace/configuration - (10000)'
Params: {
"items": []
}
[Trace - 10:21:43] Sending response 'workspace/configuration - (10000)'. Processing request took 0ms
Result: []
[Trace - 10:21:48] Received request 'workspace/configuration - (10000)'
Params: {
"items": []
}
[Trace - 10:21:48] Sending response 'workspace/configuration - (10000)'. Processing request took 0ms
Result: []
[Trace - 10:21:53] Received request 'workspace/configuration - (10000)'
Params: {
"items": []
}
[Trace - 10:21:53] Sending response 'workspace/configuration - (10000)'. Processing request took 0ms
Result: []
I wonder why ELS does that? Why not reading just the configuration one time?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 1 reply
-
A language client, i.e., an editor, usually starts the language server as a child process. When the editor crashes for some reason, the language server may not be killed and may remain. In fact, this rarely happens when VSCode hangs.
Therefore, ELS periodically communicates with the client to check if the editor is still alive. The workspace/configuration request is the way to do this. By default, ELS automatically shuts down if there is no response from the client for 10 seconds.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks for your great explanation!
This usecase can occur with any language server and we had the similar problem with your language servers written in Java XML language server and Java language server and to fix this issue we use the pid received in the LSP initialize parameters and check if the process is still alive by using ParentProcessWatcher.java
On windows it is not perfect because the cmd tasklist can take some CPU (see code line at https://github.com/eclipse-jdtls/eclipse.jdt.ls/blob/cbb11e0b64d03cff719576f88920af3a7e62b117/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/ParentProcessWatcher.java#L91). See discussion at eclipse-lemminx/lemminx#328
I wanted just to share with you how we cover this issue.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Thank you for sharing the information. I've reported this as a code issue.
Beta Was this translation helpful? Give feedback.