Skip to content

Commit

Permalink
Fix for windows IO perf issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
yaohaizh authored and fbricon committed May 1, 2019
1 parent 05fa63d commit 8b830d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.List;
import java.util.Set;

import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
Expand All @@ -31,6 +32,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jdt.ls.core.internal.AbstractProjectImporter;
Expand Down Expand Up @@ -174,7 +176,12 @@ private void updateProjects(Collection<IProject> projects, long lastWorkspaceSta
while (iterator.hasNext()) {
IProject project = iterator.next();
project.open(monitor);
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
if (Platform.OS_WIN32.equals(Platform.getOS())) {
project.refreshLocal(IResource.DEPTH_ONE, monitor);
((Workspace) ResourcesPlugin.getWorkspace()).getRefreshManager().refresh(project);
} else {
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
if (!needsMavenUpdate(project, lastWorkspaceStateSaved)) {
iterator.remove();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ public void cleanupResources(IProject project) throws CoreException {
private void deleteInvalidProjects(Collection<IPath> rootPaths, IProgressMonitor monitor) {
List<String> workspaceProjects = rootPaths.stream().map((IPath rootPath) -> ProjectUtils.getWorkspaceInvisibleProjectName(rootPath)).collect(Collectors.toList());
for (IProject project : getWorkspaceRoot().getProjects()) {
if (project.equals(this.getDefaultProject())) {
continue;
}
if (project.exists() && (ResourceUtils.isContainedIn(project.getLocation(), rootPaths) || ProjectUtils.isGradleProject(project)) || workspaceProjects.contains(project.getName())) {
try {
project.getDescription();
Expand Down

0 comments on commit 8b830d9

Please sign in to comment.