-
Notifications
You must be signed in to change notification settings - Fork 401
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
Cancel init or update workspace job of removed rootPaths #1064
Cancel init or update workspace job of removed rootPaths #1064
Conversation
Signed-off-by: Poytr1 <[email protected]>
@Poytr1 Could you, please, add some unit tests? |
Signed-off-by: Poytr1 <[email protected]>
de9c385
to
aed1e27
Compare
Signed-off-by: Poytr1 <[email protected]>
3bd5853
to
0594378
Compare
@snjeza Done! |
|
||
@Before | ||
public void setup() throws Exception { | ||
server = new JDTLanguageServer(projectsManager, preferenceManager); |
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.
you need to store the workspace autobuilding value
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.
done
server.disconnectClient(); | ||
JavaLanguageServerPlugin.getInstance().setProtocol(null); | ||
try { | ||
projectsManager.setAutoBuilding(true); |
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.
restore workspace's initial autobuild value
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.
done
Signed-off-by: Poytr1 <[email protected]>
Signed-off-by: Poytr1 [email protected]
When we call
java/didChangeWorkspaceFolders
, we may remove some workspaces. However, when the removed workspace is still in the initialization phase, the initialize/update workspace job is still at WAITING status or RUNNING status. We have not canceled these jobs, and they will still execute in the background, occupying resources. The potential problem is that if I delete this workspace, I might get an exception from these jobs.This PR is used to add a new family(rootpaths) for the initialize and update jobs, so that you can find these background workspace jobs for initializing the workspace based on removed rootpaths and try to cancel them.
@fbricon How do you think about this?