Skip to content

Commit

Permalink
Handle any folder that links to a project
Browse files Browse the repository at this point in the history
  • Loading branch information
fvclaus committed Oct 5, 2023
1 parent b4b3d43 commit c2f1f49
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.stream.Collectors;

import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.internal.utils.FileUtil;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
Expand Down Expand Up @@ -585,12 +584,9 @@ public static IProject getProject(String projectUri) {
if (maybeProject.isPresent()) {
return (IProject) maybeProject.get();
} else {
String invisibleProjectName = ProjectUtils.getWorkspaceInvisibleProjectName(FileUtil.toPath(uri).removeTrailingSeparator());
IProject invisibleProject = root.getProject(invisibleProjectName);
if (!invisibleProject.exists()) {
throw new IllegalArgumentException(projectUri + " is neither a Java nor an invisible project.");
}
return invisibleProject;
// This must be a folder that has been linked to project outside the workspace
// for example an invisible project or a project created by a third party extension.
return containers[0].getProject();
}
}

Expand Down

0 comments on commit c2f1f49

Please sign in to comment.