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

Build workspace action can report progress to client #1368

Merged
merged 1 commit into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jdt.core.IJavaModelMarker;
import org.eclipse.jdt.ls.core.internal.BuildWorkspaceStatus;
import org.eclipse.jdt.ls.core.internal.ProjectUtils;
Expand All @@ -51,8 +52,9 @@ public BuildWorkspaceStatus buildWorkspace(boolean forceReBuild, IProgressMonito
}
projectsManager.cleanupResources(projectsManager.getDefaultProject());
if (forceReBuild) {
ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.CLEAN_BUILD, subMonitor.split(50));
ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, subMonitor.split(50));
} else {
ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@
import org.eclipse.lsp4j.SignatureHelpParams;
import org.eclipse.lsp4j.SymbolInformation;
import org.eclipse.lsp4j.TextDocumentIdentifier;
import org.eclipse.lsp4j.TextDocumentPositionParams;
import org.eclipse.lsp4j.TextEdit;
import org.eclipse.lsp4j.TypeDefinitionParams;
import org.eclipse.lsp4j.Unregistration;
Expand Down Expand Up @@ -542,7 +541,7 @@ public CompletableFuture<Hover> hover(HoverParams position) {
}

/* (non-Javadoc)
* @see org.eclipse.lsp4j.services.TextDocumentService#signatureHelp(org.eclipse.lsp4j.TextDocumentPositionParams)
* @see org.eclipse.lsp4j.services.TextDocumentService#signatureHelp(org.eclipse.lsp4j.SignatureHelpParams)
*/
@Override
public CompletableFuture<SignatureHelp> signatureHelp(SignatureHelpParams position) {
Expand Down Expand Up @@ -781,7 +780,7 @@ public void projectConfigurationUpdate(TextDocumentIdentifier param) {
public CompletableFuture<BuildWorkspaceStatus> buildWorkspace(boolean forceReBuild) {
logInfo(">> java/buildWorkspace (" + (forceReBuild ? "full)" : "incremental)"));
BuildWorkspaceHandler handler = new BuildWorkspaceHandler(pm);
return computeAsync((monitor) -> handler.buildWorkspace(forceReBuild, monitor));
return computeAsyncWithClientProgress((monitor) -> handler.buildWorkspace(forceReBuild, monitor));
}

/* (non-Javadoc)
Expand Down