|
12 | 12 | package com.microsoft.java.debug.plugin.internal;
|
13 | 13 |
|
14 | 14 | import java.util.ArrayList;
|
| 15 | +import java.util.Collection; |
15 | 16 | import java.util.Collections;
|
16 | 17 | import java.util.Comparator;
|
17 | 18 | import java.util.List;
|
|
23 | 24 |
|
24 | 25 | import org.apache.commons.lang3.StringUtils;
|
25 | 26 | import org.eclipse.core.resources.IFile;
|
| 27 | +import org.eclipse.core.resources.IFolder; |
26 | 28 | import org.eclipse.core.resources.IProject;
|
27 | 29 | import org.eclipse.core.resources.IResource;
|
28 | 30 | import org.eclipse.core.runtime.CoreException;
|
|
37 | 39 | import org.eclipse.jdt.core.search.SearchParticipant;
|
38 | 40 | import org.eclipse.jdt.core.search.SearchPattern;
|
39 | 41 | import org.eclipse.jdt.core.search.SearchRequestor;
|
| 42 | +import org.eclipse.jdt.ls.core.internal.ProjectUtils; |
40 | 43 | import org.eclipse.jdt.ls.core.internal.ResourceUtils;
|
41 | 44 | import org.eclipse.jdt.ls.core.internal.managers.ProjectsManager;
|
42 | 45 |
|
@@ -107,7 +110,8 @@ public void acceptSearchMatch(SearchMatch match) {
|
107 | 110 | String projectName = ProjectsManager.DEFAULT_PROJECT_NAME.equals(project.getName()) ? null : project.getName();
|
108 | 111 | if (projectName == null
|
109 | 112 | || targetProjectPath.isEmpty()
|
110 |
| - || ResourceUtils.isContainedIn(project.getLocation(), targetProjectPath)) { |
| 113 | + || ResourceUtils.isContainedIn(project.getLocation(), targetProjectPath) |
| 114 | + || isContainedInInvisibleProject(project, targetProjectPath)) { |
111 | 115 | String filePath = null;
|
112 | 116 |
|
113 | 117 | if (match.getResource() instanceof IFile) {
|
@@ -141,6 +145,15 @@ public void acceptSearchMatch(SearchMatch match) {
|
141 | 145 | return resolutions;
|
142 | 146 | }
|
143 | 147 |
|
| 148 | + private boolean isContainedInInvisibleProject(IProject project, Collection<IPath> rootPaths) { |
| 149 | + if (project == null) { |
| 150 | + return false; |
| 151 | + } |
| 152 | + |
| 153 | + IFolder workspaceLinkFolder = project.getFolder(ProjectUtils.WORKSPACE_LINK); |
| 154 | + return workspaceLinkFolder.exists() && ResourceUtils.isContainedIn(workspaceLinkFolder.getLocation(), rootPaths); |
| 155 | + } |
| 156 | + |
144 | 157 | private ValidationResponse validateLaunchConfigCore(List<Object> arguments) throws CoreException {
|
145 | 158 | ValidationResponse response = new ValidationResponse();
|
146 | 159 |
|
|
0 commit comments