-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java server refreshing the workspace for each restart on Windows #880
Conversation
src/javaServerStarter.ts
Outdated
@@ -66,12 +67,6 @@ function prepareParams(requirements: RequirementsData, javaConfiguration, worksp | |||
if (vmargs.indexOf(encodingKey) < 0) { | |||
params.push(encodingKey + getJavaEncoding()); | |||
} | |||
if (os.platform() == 'win32') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS Code doesn't kill Java LS server anymore. See microsoft/vscode#35196 and https://github.com/Microsoft/vscode-languageserver-node/blob/master/client/src/main.ts#L418
Restarting spring-boot workspace, I see the shutdown doesn't complete, and the workspace is still not properly saved:
|
Could you test with https://raw.githubusercontent.com/snjeza/vscode-test/master/java-0.43.1.vsix ? |
This is on another workspace, but this looks much better, shutdown takes several seconds to complete, but does complete with your special build:
|
src/javaServerStarter.ts
Outdated
if (os.platform() === 'win32') { | ||
const vmargs = javaConfig.get('jdt.ls.vmargs', ''); | ||
const watchParentProcess = '-DwatchParentProcess='; | ||
if (vmargs.indexOf(watchParentProcess) >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
watchParentProcess is always present, as per L78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is called before the prepareParams method (L78).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@snjeza , why do we need to set detatched
to true
only on Windows ? Does https://github.com/microsoft/vscode-languageserver-node/blob/e7b7e3134791c4208165aa57fb9182895df8ec6c/client/src/node/main.ts#L201 just work on Linux/MacOS ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it just works. I think it is the default on Linux/Mac.
@fbricon @snjeza Could this change microsoft/vscode-languageserver-node#485 fix the parent watching process issue? |
I have updated the PR. |
@snjeza I tested this change on Windows and observed that after reloading the window, the message One question: I think the key point is |
We could set it as the default. It will not run tasklist (on Windows) or kill (on Linux/Mac)t after eclipse-jdtls/eclipse.jdt.ls#2115 |
@jdneo @snjeza How does this change solve the issue on Windows, with only defaults if |
@rgrunber you should set |
If this helps the situation, then I'm fine with merging. I just don't see how it would benefit the issue without users also overriding the default |
See #880 (comment) |
When I tested this change, I manually changed the vmargs. @snjeza Could you help me understand the relationship between |
We have disabled
|
Signed-off-by: Snjezana Peco <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested on the Windows machine.
Opening eclipse.jdt.ls project:
- Without the change, takes around 60s
- With the change, it takes around 30s.
Just found the previous background eclipse-lemminx/lemminx#328 to disable parentProcessWatcher by default. Since we've optimized the server-side parentProcessWatcher via the JDK native API, it is worth to enable it back if the performance gains are high. I suggest we put it in pre-release for a try first. |
Fixes #793
Signed-off-by: Snjezana Peco [email protected]