Skip to content
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

Optimize server initialization #981

Closed
fbricon opened this issue Apr 4, 2019 · 0 comments
Closed

Optimize server initialization #981

fbricon opened this issue Apr 4, 2019 · 0 comments

Comments

@fbricon
Copy link
Contributor

fbricon commented Apr 4, 2019

As described in #824 (comment), a number of optimizations related to the server initialization could be implemented:

4- WorkspaceDiagnosticsHandler is added before JDT LS is initialized when the initialization lasts more than five minutes. See JobHelpers.waitForInitializeJobs()
VS Code 0.42.0 sends 4800+ the publishDiagnostics events. if we add WorkspaceDiagnosticsHandler after the initialization, VS Code sends 1080 events.

5 - Java LS watches changed files before it is initialized. We can't stop watchers that are statically added - https://github.com/redhat-developer/vscode-java/blob/master/src/extension.ts#L60. I have removed those watchers from vscode-java and added them dynamically to Java LS. VS Code sends 5800 didChangeWatchedFiles events when importing the che project. If watchers are registered after initializing Java LS, VS Code won't send any events. Related issue: #926

6 - The VS Code Java client adds the '/src/' watcher. That's why VS Code sometimes sends duplicate didChangeWatchedFiles events if a project has source folders within the src directory. I have skipped all watchers containing the /src/ string in their path.

7 - org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(Collection, IProgressMonitor) runs as a Java runnable which is not necessary because the isAutoBuilding property is false in that moment. I have removed it.

The part with the file watchers is actually related to #926

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants