-
Notifications
You must be signed in to change notification settings - Fork 408
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
Fix perf issue by preventing unnecessary building when open workspace. #756
Conversation
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.
-1: diagnostics are no longer reported after reopening a existing project
Diagnostic will be triggered by auto build in the back ground. This change is remove the force build in the foreground. |
No longer publishing diagnostics is a regression we can't allow. Background thread or not. They are absolutely not reported after opening the folder. I'm seeing that regression with this PR |
The diagnostic information is published after this change for auto build scenario. The diagnostic information is NOT published if disable auto build. I can enable the force build for disable auto build scenario, but it is weird behavior. |
try opening https://github.com/spring-projects/spring-amqp in vscode with this PR
I tried with the an empty workspaceStorage in vscode insiders |
This is an interesting thing. I originally used https://github.com/elastic/elasticsearch for testing gradle which is a large scale project, which makes diagnostic information published when reload. Given these information, I think this should be the cause for the difference: #758 Given these, I will firstly make the force build as a worker thread to publish diagnostics. |
@fbricon Updated the PR to handle diagnostic situation. |
@@ -128,6 +143,66 @@ else if (projectsManager.isBuildFile(file)) { | |||
return false; | |||
} | |||
|
|||
public List<IMarker> publichDiagnostic(IProgressMonitor monitor) throws CoreException { |
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.
publishDiagnostics
for (IProject project : projects) { | ||
if (monitor != null && monitor.isCanceled()) { | ||
throw new OperationCanceledException(); | ||
} |
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.
ignore default project, I think
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.
It turns out this is the problem markers, but it will be ignored by publish diagnostics, which is the same behavior as the current design.
@fbricon Fixed the issues. |
test this please |
@fbricon What happened with Jenkins? |
The PR fails to compile:
|
@@ -62,7 +62,7 @@ public BuildWorkspaceStatus buildWorkspace(boolean forceReBuild, IProgressMonito | |||
} | |||
} | |||
ResourcesPlugin.getWorkspace().build(forceReBuild ? IncrementalProjectBuilder.FULL_BUILD : IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor); | |||
List<IMarker> problemMarkers = workspaceDiagnosticsHandler.publichDiagnostic(monitor); | |||
List<IMarker> problemMarkers = workspaceDiagnosticsHandler.publichDiagnostics(monitor); |
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.
it's publishDiagnostics with sh, not ch
test this please |
Signed-off-by: Yaohai Zheng <[email protected]>
@fbricon Updated PR |
@gorkem @fbricon
The force build on initialized will block the LSP protocol to wait for its response. And this action is not necessary to triggered every time when the auto build is true.
Restore the auto building value will make building as a worker thread and response to the client quickly.
With this change, eclipse.jdt.ls will match the performance of eclipse on import/reopen scenario.